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

Version Control System Using Git

This document discusses version control systems and Git. It explains that version control systems allow tracking changes to code over time, enabling easy collaboration. Git is introduced as a distributed version control system that stores snapshots of files and tracks changes. The key stages of Git - the working directory, staging area and local repository - are outlined. The document demonstrates common Git commands for setting up repositories, tracking changes, committing snapshots, branching and merging code, and sharing changes via patches. In summary, Git provides an efficient workflow for software development by making it easy to create, merge and share code branches.

Uploaded by

tsitokelyko
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Version Control System Using Git

This document discusses version control systems and Git. It explains that version control systems allow tracking changes to code over time, enabling easy collaboration. Git is introduced as a distributed version control system that stores snapshots of files and tracks changes. The key stages of Git - the working directory, staging area and local repository - are outlined. The document demonstrates common Git commands for setting up repositories, tracking changes, committing snapshots, branching and merging code, and sharing changes via patches. In summary, Git provides an efficient workflow for software development by making it easy to create, merge and share code branches.

Uploaded by

tsitokelyko
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 35

Version Control

System using
Git
Presented by:

Rohit Das Rudra Nil Basu


3000114022 30000114023
[email protected] [email protected]
1. Why do we need
Version Control
The Problem System anyway?
-
-

Maintaining group Projects
Patches are mostly sent via
email
- Difficult to roll back
- Almost impossible to maintain
if the number of people
working in the project is large

- Testing new unstable features


2.
Version Control
System
Version Control: What is
it?
▸A method for recalling
versions of a codebase
▸Keeping a record of
changes
▸Who did what and when
in the system
▸Save yourself when
things inevitably go
wrong
Version Control: Why?
Individual
▸Back-ups of the project
▸Create a “checkpoint” in the project at any stage: Fearlessly
modify code
▸Tagging: Mark certain point in time
▸Branching: Release versions and continue development
Version Control: Why?
Team
▸Everything in “Individual”
▸Allow multiple developer to work on the same
codebase
▸Merge changes across same files: handle
conflicts
▸Check who made which change: blame/praise
Version Control: Types

▸Centralised VCS ▸Distributed VCS


A single authoritative data source
Centralised (repository)
VCS  Check-outs and check-ins are done with
reference to this central repository
Centralised
VCS
Examples:
Centralised
VCS  Concurrent Version System (CVS)
 Subversion (SVN)
• No single repository is authoritative 
• Data can be checked in and out from Distributed
any repository VCS
Distributed
VCS
Examples
Distributed
• Git VCS
• Mercurial
3.
Git --everything-is-local
• Free, open source
• Fully distributed
• Handle small files
very effectively
• Tracks contents,
not files
• Data = Snapshot
• No network
• Three stages
• Created by Linus
Torvalds in less
than 2 weeks
• Currently
maintained by
Junio C Hamano
Three stages:

Git: Stages  Working directory


 Staging directory
 Git directory (repository)
Setup
Git:
Development  git init
 git clone <remote-url>
Check “snapshots” of the codebase

Git:  git log


Development
Show commit logs
Commit logs

Git:
Development
Branches
Git:  git checkout –b <branch-name>
Development
View changes
Git:
Development  git diff
View changes

Git:
Development
Update staging area

Git:  git add <files>


Development
Add file contents to the index
Create “snapshots” of your codebase

Git:  git commit


Development
Records changes to the repository
Merge other branches

Git:  git merge


Development
Git:
Development
Make patches

 git format-patch --stdout > fix.patch


Git:
Development Patch created as “fix.patch”
Prepare patches for email submission
Send patch via mail
Make patches

Git:
Development
Applying patches

Git:  git apply < fix.patch


Development
Applies changes from the patch
 Much efficient workflow
Result?  Creating and merging branches are very
easy and fast
The development process of the Linux kernel
is maintained using Git

Result? The Linux kernel development process has:


 Over 2000 individual contributors per year
 Grows by nearly 300,000 lines per year
THANK YOU!

Rohit Das Rudra Nil Basu


[email protected] [email protected]
mouri11.github.io rudranilbasu.me

You might also like