0% found this document useful (0 votes)
10 views3 pages

GitandGithubBest PDF

Got and GitHub

Uploaded by

vijendrahomeacc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views3 pages

GitandGithubBest PDF

Got and GitHub

Uploaded by

vijendrahomeacc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Linus Torvalds - Linux and Git

What are we going to learn?


-> Git and Github.

Why are we learning Git and Github?


-> Have you ever made a project document or report in college?
a. You start writing.
b. You shart adding more and more content.
c. You edit content.
d. But what if you added a whole lot of things that are not required in the
document?
e. What if you do not have track of what you have edited and when?
f. Even if you know what you have to remove, won’t it be a tedious job to make all
those changes?
g. What if different people want to work on the same file to reduce time and
effort?
h. What if you lost or deleted the document by mistake?

Developers also face the above problem when working on the project and maintaining
the source code.

So the problem we may face is


a. Cannot keep track of the changes made in the file and by whom.
b. No versioning of the file is available.
c. There is no backup.
d. There is no centralized location through which multiple users can access.

To solve the above problem we are learning Git and Github.

Before telling about Git let me give some more basic information

1. What is a Version Control System?


a. As the name suggests, it is a software tool for tracking and managing each
and every change made in a source code during the project development.
b. Allows us to turn back to a certain version of the source code which is
required in case of some modification or if some error prone code is added
in the source code.
2. What are types of Version Control System?
a. Local Version Control System
b. Centralized Version Control System
c. Distributed Version Control System
3. What is a Local Version Control System?
a. Located in our local machine.
b. We will be able to maintain different versions of the source code.
c. But, if the system crashes the source code will be lost and the
versionaling mechanism which is used will be of no use.
d. It is not possible to work with multiple developers.
4. What is a Centralized Version Control System?
a. To solve the above problem related to not being able to work with multiple
developers, we can make use of the Centralized Version Control System.
b. There will be a single central server that will have all the source code
maintained in something that is called a repository.
c. Our local system will be connected to the server which is having the source
code.
d. The server will have a certain version of the source code and our local
system will have a certain version of source because we may be working on
it.
e. But what if the server crashes? Only local systems will have the source
code and all of them will be different versions of the source code.

5. What is a Distributed Version Control System?


a. There will be one or many servers maintaining the code in the repository.
b. Many developers work on the source code.
c. And each developer in their local machine will be maintaining a repository.
d. Local machine repository will have a copy of the source code.
e. Even if a server crashes, a copy of the source code will be present in
other servers and in the local machine repository.

6. What is Git?
a. Git is a software and version control tool to track changes in the source
code.
7. What is Github?
a. Github is a web based cloud service to host the source code in a Git
repository.
b. Github requires Git. But, Git does not require Github.

Git commands
1. git init
2. git status
3. git add <file> -> adding one file
4. git add . or git add *.* -> adding multiple changes
5. git commit –m “message”
6. git config --global user.email “[email protected]
7. git config --global user.name “password”
8. git remote add origin <URL>
9. git push –u origin master
10. git clone <URL>
11. git branch <branch-name>
12. git checkout <branch-name>
13. git add <files>
14. git commit –m “message”

You might also like