0% found this document useful (0 votes)
50 views14 pages

An Introduction To Git

Git is a distributed version control software that allows storing multiple versions of code. It tracks changes and allows synchronizing code between developers. Git allows testing new code without affecting original code. Code can be reverted to older versions if needed. Git is installed locally and used via command line. GitHub is a hosting service for Git repositories with a graphical interface. Branches allow diverging from main development line without affecting it.

Uploaded by

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

An Introduction To Git

Git is a distributed version control software that allows storing multiple versions of code. It tracks changes and allows synchronizing code between developers. Git allows testing new code without affecting original code. Code can be reverted to older versions if needed. Git is installed locally and used via command line. GitHub is a hosting service for Git repositories with a graphical interface. Branches allow diverging from main development line without affecting it.

Uploaded by

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

An Introduction to Git

By - Nihal Singh
What is Git ?
• Git is a distributed version control software.
• It is used to store multiple version of your software on your machine.
• Nowadays, it is being used for deploying your code from your local machine
to some staging server to some testing server and ultimately to production.
• It’s become an integral tool for deploying your code to cloud.

“ Git is a free and open source distributed version control system [1] ”


- Git
Control Software - This basically means that Git is a content tracker. So
Git can be used to store content (code).

Version Control System - The code which is stored in Git keeps


changing as more code is added. Also, many developers can add code in
parallel. So Version Control System helps in handling this by
maintaining a history of what changes have happened. 
What does Git do ?
(1) It is good at keeping track of changes

Created a file Added a line Removed a line


(2) Synchronizes code between different people

Version of code stored up


in some remote server

Remote Server

Local Machine Access to the copy of same code Local Machine


on individual local machines
(3) Testing of new code without losing the original working code

Original Code New working code

( Test successful )

Changes made to the COPY of original code


(4) Revert back to old version of code

Create a file Add a line Revert back to old version


( Doesn’t work )
Setting up Git on Windows

1. Download Git setup from Git’s official website.

2. Run the Git’s installer.

3. To check Git is installed successfully, open Git Bash (Git Bash comes included as part of

the Git For Windows package ) and run a command “git –version”.

4. Setting up Git profile

• Create a user name ( Command – git config –global user.name “Name” )

• Create a email ( Command - git config –global user.email [email protected] )


Workflow of Git
1. Create a repository ( Command - git init )

2. Create a file ( Command - echo > filename.extension )

3. Stage the file ( Command - git add filename.extension


)

4. To check if the staging was done rightly ( Command - git status )

5. Commit the file or the new changes in new file ( Command - git commit –
m “a msg” )

6. Check the commits or the history of the repo ( Command - git log )
Concept of branch in Git

Branching means you diverge from the main line of development and continue to do work
without messing with that main line commonly known as ‘master’ branch [1]
Creating and merging branches in Git

1. Checking the current branch on which we are working and number of branches ( Command -
git branch )

2. Creating the new branch. For the sake of the example, let’s name it ‘testing’ ( Command -
git branch testing )

3. Switching to the newly created branch ( Command – git checkout test )

4. Merging the newly created branch with the ‘master’ branch ( Command - git
checkout master) ( Command - git merge testing)
Git vs Github [2]

Git Github

• It is a software • It is a service
•  It is installed locally on the system • It is hosted on the Web
• It is a command-line tool • It provides a graphical interface
• It is a tool to manage different versions of • It is a space to upload a copy of
edits made to files in a git repository your Git repository
• It provides functionalities like Version Control • It provides functionalities of Git like VCS and
System Source Code Management Source Code Management, as well as adding
few of its own features
Alternatives & Competitors to Git [3]

1. Microsoft Team Foundation Server


2. Helix Core
3. Subversion
4. AWS CodeComit
5. Rational ClearCase
6. Mercurial
References

1. https://git-scm.com/
2. https://dzone.com/articles/git-vs-github-demystifying-the-differences
3. https://www.g2.com/products/git/competitors/alternatives

You might also like