0% found this document useful (0 votes)
76 views

2 GIT Version Control System (VCS)

Version control systems (VCS) like Git allow developers to manage multiple versions of code and documents. Git is a distributed VCS created by Linus Torvalds that is designed for speed, handling large projects, and supporting thousands of parallel branches. It works by tracking changes to files in a local repository that can then be committed and pushed to remote repositories hosted on platforms like GitHub.

Uploaded by

vort
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)
76 views

2 GIT Version Control System (VCS)

Version control systems (VCS) like Git allow developers to manage multiple versions of code and documents. Git is a distributed VCS created by Linus Torvalds that is designed for speed, handling large projects, and supporting thousands of parallel branches. It works by tracking changes to files in a local repository that can then be committed and pushed to remote repositories hosted on platforms like GitHub.

Uploaded by

vort
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/ 16

GIT

Version Control System(VCS)

By : A K Ajay, C-INFOTECH | citpune.com

By : A K Ajay, C-INFOTECH | citpune.com


What is VCS ?
● Version control (or revision control, or source control) is all about
managing multiple versions of documents, programs, web sites, etc.
○ Almost all “real” projects use some kind of version control
○ Essential for team projects, but also very useful for individual projects
● Some well-known version control systems are CVS, Subversion,
Mercurial, and Git
○ CVS and Subversion use a “central” repository; users “check out” files, work on
them, and “check them in”
○ Mercurial and Git treat all repositories as equal
● Distributed systems like Mercurial and Git are newer and are
gradually replacing centralized systems like CVS and Subversion

By : A K Ajay, C-INFOTECH | citpune.com


Benefits of using VCS
● Backup: Undo or refer to old stuff
● Branch: Maintain old release while working on new
● Collaborate: Work in parallel with teammates
● Help you track/manage/distribute revisions
● Standard in modern development
● Enable sharing version control repos
● Internet/Web based
By : A K Ajay, C-INFOTECH | citpune.com
Popular VCS Platforms
● SourceForge
● Bitbucket
● GitLab
● GitHub

By : A K Ajay, C-INFOTECH | citpune.com


Inbrief , Why you should use version control ?
Individual Developer
For an Individual developer,
It gives a “time machine” like
feeling for going back to
earlier changes and maintains
change history (called
versions)
Team
For working with others or
Team : It simplifies concurrent
work and merging changes

By : A K Ajay, C-INFOTECH | citpune.com


Brief About GIT
● Created by Linus Torvalds in 2005, the creator of Linux
● Came out of Linux development community
● Designed to do version control on Linux kernel

Goals & Objective of Git:

● Speed
● Support for non-linear development
● (thousands of parallel branches)
● Fully distributed
● Able to handle large projects efficiently

By : A K Ajay, C-INFOTECH | citpune.com


GIT Version Tree

By : A K Ajay, C-INFOTECH | citpune.com


How GIT works
GITHUB/BITBUCKET /….
You (Developer)
Remote Repos
Your Working Dir

By : A K Ajay, C-INFOTECH | citpune.com


GIT Workflow

By : A K Ajay, C-INFOTECH | citpune.com


Important GIT Commands

By : A K Ajay, C-INFOTECH | citpune.com


GIT Operation and File Lifecycle

By : A K Ajay, C-INFOTECH | citpune.com


Typical GIT flow
● git pull remote_repository : Get changes from a remote
repository and merge them into your own repository
● git status To See what Git thinks is going on
● Use this frequently!
● Work on your files
● git add –-all (or just changes)
● git commit –m “What I did”
● git push
By : A K Ajay, C-INFOTECH | citpune.com
Installing GIT & Configuring
Git website: http://git-scm.com/

Set the name and email for Git to use when you commit:

– git config --global user.name "Bugs Bunny"

– git config --global user.email [email protected]

– You can call git config –list to verify these are set.

• Set the editor that is used for writing commit messages:

– git config --global core.editor nano

By : A K Ajay, C-INFOTECH | citpune.com


Creating Repository or repo
To create a new local Git repo in your current directory:
● git init : This will create a .git directory in your current directory. Then you
can commit files in that directory into the repo.
● git add filename
● git commit –m "commit message"
To clone a remote repo to your current directory:
● – git clone url localDirectoryName : This will create the given local
directory, containing a working copy of the files from the repo, and a .git
directory (used to hold the staging area and your actual local repo)

By : A K Ajay, C-INFOTECH | citpune.com


Hands-on

By : A K Ajay, C-INFOTECH | citpune.com


By : A K Ajay, C-INFOTECH | citpune.com

You might also like