SlideShare a Scribd company logo
Version Control
Hem Kr. Shrestha
Date: 3rd January, 2017
Introduction to Version Control
● It is a component of Software Configuration Management
● It is also known as Revision Control or Source Control
● It is the management of changes to documents, programs,
and other information stored as computer files
● It keeps track of every modification over time in a special
kind of database
Before Version Control
● File Renaming
○ Rename “Code.java” to “Code01.java” or
“CodeDec25.java”
● Directory Renaming
○ Rename “src” folder to “src-2016Dec20”
● Zip File
○ Compress “MyProject” directory into
“MyProject-2016Dec15.zip”
Why Version Control
● Backup and Restore
● Collaboration
● Short-term undo
● Long-term undo
● Track Changes
● Track Ownership
● Branching and merging
Software Versioning Types
1. Centralized version control system (CVCS)
○ Central server is dedicated host, like “master copy”
○ Stores files history and controls access to files.
○ This is kept separately from your working copy.
○ Eg. SVN
2. Distributed version control system (DVCS).
○ Every clone of repository is independent and act as full fledged system
○ Stows the entire history of project files into a special hidden folder inside the
working copy on your hard drive.
○ Every commit gets added to the history in that hidden folder.
○ Eg. GIT, Mercurial, Bazaar
Why Distributed Version Control
● Cheap local branches for easy
experimentation
● History aware merges
● Full local history
● Offline commits
● To and fro revert back instantly
● Each working copy is a complete
backup of the repository
Version Control Concepts
● Repository - The database storing the files.
● Server - The computer storing the repo.
● Client - The computer connecting to the repo.
● Working set / Working copy - Your local directory of files, where you make
changes.
● Trunk / Main - The primary location for code in the repo.
● Branch - Create a separate copy of a file/folder for private use
● Commit - Command to store that version with some message input
● Checkout and revert - Jump to specific commit or branch or tags
Version Control Concepts contd...
● Merge - Apply the changes from one file to another, to bring it up-to-date.
● Conflict - When pending changes to a file contradict each other
● Resolve - Fixing the changes that contradict each other
● Tags - Static branch for storing a stable version
● Clone - Copy project to local from remote
● Push / Pull - send changes from local to remote or vice versa
● Logs - view the list of versions we have committed
● Diff - view changes within two points of commit or branches or tags
● Status - view local changes and files currently
Version Control Best Practices
● Use Good comments
● Commit often
● Single and multi project repos
● Branch / Tag when appropriate
● Respect the repository trunk (master)
Git Commands
● Git init
● Git add .
● Git status
● Git commit -m “first push”
● Git diff
● Git log
● Git remote add origin “http://origin.url”
● Git push origin master
Git Online Repo Services
● Github.com
○ Public repo for free
○ Charges for private repo
● Bitbucket.org
○ Best for private repo
○ Charges for more than 5 user contributions
● Gitlab.com
○ Have both private as well as public repo
Git Demo
References
● https://betterexplained.com/articles/a-visual-guide-to-version-control/
● https://www.atlassian.com/git/tutorials/what-is-version-control/
● https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control
● http://blog.hemshrestha.com.np/2013/12/11/startup-with-git-source-code-mana
gement/
Questions ?
Thank You !

More Related Content

Similar to Version Control - Hem Shrestha

Slide set 7 (Source Code Management History Overview) - Copy.pptx
Slide set 7 (Source Code Management History  Overview) - Copy.pptxSlide set 7 (Source Code Management History  Overview) - Copy.pptx
Slide set 7 (Source Code Management History Overview) - Copy.pptx
UTKARSHBHARDWAJ71
 

Similar to Version Control - Hem Shrestha (20)

Version Control History and Git Basics
Version Control History and Git BasicsVersion Control History and Git Basics
Version Control History and Git Basics
 
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
Source Control with Domino Designer 8.5.3 and Git (DanNotes, November 28, 2012)
 
01 - Git vs SVN
01 - Git vs SVN01 - Git vs SVN
01 - Git vs SVN
 
GIT INTRODUCTION
GIT INTRODUCTIONGIT INTRODUCTION
GIT INTRODUCTION
 
Understanding GIT and Version Control
Understanding GIT and Version ControlUnderstanding GIT and Version Control
Understanding GIT and Version Control
 
GIT
GITGIT
GIT
 
Subversion
SubversionSubversion
Subversion
 
Git.pptx
Git.pptxGit.pptx
Git.pptx
 
SouthEast LinuxFest 2015 - intro to git
SouthEast LinuxFest 2015 -  intro to gitSouthEast LinuxFest 2015 -  intro to git
SouthEast LinuxFest 2015 - intro to git
 
git Versioning
git Versioninggit Versioning
git Versioning
 
Git&GitHub.pptx
Git&GitHub.pptxGit&GitHub.pptx
Git&GitHub.pptx
 
Getting Started with Git: A Primer for SVN and TFS Users
Getting Started with Git: A Primer for SVN and TFS UsersGetting Started with Git: A Primer for SVN and TFS Users
Getting Started with Git: A Primer for SVN and TFS Users
 
SFO15-TR2: Upstreaming 101
SFO15-TR2: Upstreaming 101SFO15-TR2: Upstreaming 101
SFO15-TR2: Upstreaming 101
 
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, TrivandrumIntroduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
Introduction to Git and Github - Google Developer Student Clubs CET, Trivandrum
 
version controlling in software development
version controlling in software developmentversion controlling in software development
version controlling in software development
 
Slide set 7 (Source Code Management History Overview) - Copy.pptx
Slide set 7 (Source Code Management History  Overview) - Copy.pptxSlide set 7 (Source Code Management History  Overview) - Copy.pptx
Slide set 7 (Source Code Management History Overview) - Copy.pptx
 
Git and github fundamentals
Git and github fundamentalsGit and github fundamentals
Git and github fundamentals
 
Version control with GIT
Version control with GITVersion control with GIT
Version control with GIT
 
Mercurial presentation
Mercurial presentationMercurial presentation
Mercurial presentation
 
introduction in version control system
introduction in version control systemintroduction in version control system
introduction in version control system
 

Recently uploaded

Ralph - Project Presentation Enhancing System Security at Acme Flight Solutio...
Ralph - Project Presentation Enhancing System Security at Acme Flight Solutio...Ralph - Project Presentation Enhancing System Security at Acme Flight Solutio...
Ralph - Project Presentation Enhancing System Security at Acme Flight Solutio...
MasterG
 
Part 1.pptx Part 1.pptx Part 1.pptx Part 1.pptx
Part 1.pptx Part 1.pptx Part 1.pptx Part 1.pptxPart 1.pptx Part 1.pptx Part 1.pptx Part 1.pptx
Part 1.pptx Part 1.pptx Part 1.pptx Part 1.pptx
Sheldon Byron
 
કારકિર્દીના પંથે-2024 career guidance.pdf
કારકિર્દીના પંથે-2024 career guidance.pdfકારકિર્દીના પંથે-2024 career guidance.pdf
કારકિર્દીના પંથે-2024 career guidance.pdf
SAIYEDASAD2
 
Genaihelloallstudyjamheregetstartedwithai
GenaihelloallstudyjamheregetstartedwithaiGenaihelloallstudyjamheregetstartedwithai
Genaihelloallstudyjamheregetstartedwithai
joceko6768
 

Recently uploaded (15)

129. Reviewer Certificate in BioNature [2024]
129. Reviewer Certificate in BioNature [2024]129. Reviewer Certificate in BioNature [2024]
129. Reviewer Certificate in BioNature [2024]
 
Ralph - Project Presentation Enhancing System Security at Acme Flight Solutio...
Ralph - Project Presentation Enhancing System Security at Acme Flight Solutio...Ralph - Project Presentation Enhancing System Security at Acme Flight Solutio...
Ralph - Project Presentation Enhancing System Security at Acme Flight Solutio...
 
Part 1.pptx Part 1.pptx Part 1.pptx Part 1.pptx
Part 1.pptx Part 1.pptx Part 1.pptx Part 1.pptxPart 1.pptx Part 1.pptx Part 1.pptx Part 1.pptx
Part 1.pptx Part 1.pptx Part 1.pptx Part 1.pptx
 
133. Reviewer Certificate in Advances in Research
133. Reviewer Certificate in Advances in Research133. Reviewer Certificate in Advances in Research
133. Reviewer Certificate in Advances in Research
 
0524.priorspeakingengagementslist-01.pdf
0524.priorspeakingengagementslist-01.pdf0524.priorspeakingengagementslist-01.pdf
0524.priorspeakingengagementslist-01.pdf
 
Guide to Physical Therapist Practice presentation
Guide to Physical Therapist Practice presentationGuide to Physical Therapist Practice presentation
Guide to Physical Therapist Practice presentation
 
Day care leadership document it helps to a person who needs caring children
Day care leadership document it helps to a person who needs caring childrenDay care leadership document it helps to a person who needs caring children
Day care leadership document it helps to a person who needs caring children
 
Widal Agglutination Test: A rapid serological diagnosis of typhoid fever
Widal Agglutination Test: A rapid serological diagnosis of typhoid feverWidal Agglutination Test: A rapid serological diagnosis of typhoid fever
Widal Agglutination Test: A rapid serological diagnosis of typhoid fever
 
5CL-ADBA,5cladba, the best supplier in China
5CL-ADBA,5cladba, the best supplier in China5CL-ADBA,5cladba, the best supplier in China
5CL-ADBA,5cladba, the best supplier in China
 
કારકિર્દીના પંથે-2024 career guidance.pdf
કારકિર્દીના પંથે-2024 career guidance.pdfકારકિર્દીના પંથે-2024 career guidance.pdf
કારકિર્દીના પંથે-2024 career guidance.pdf
 
0524.THOMASGIRARD_CURRICULUMVITAE-01.pdf
0524.THOMASGIRARD_CURRICULUMVITAE-01.pdf0524.THOMASGIRARD_CURRICULUMVITAE-01.pdf
0524.THOMASGIRARD_CURRICULUMVITAE-01.pdf
 
Genaihelloallstudyjamheregetstartedwithai
GenaihelloallstudyjamheregetstartedwithaiGenaihelloallstudyjamheregetstartedwithai
Genaihelloallstudyjamheregetstartedwithai
 
Master SEO in 2024 The Complete Beginner's Guide
Master SEO in 2024 The Complete Beginner's GuideMaster SEO in 2024 The Complete Beginner's Guide
Master SEO in 2024 The Complete Beginner's Guide
 
D.El.Ed. College List -Session 2024-26.pdf
D.El.Ed. College List -Session 2024-26.pdfD.El.Ed. College List -Session 2024-26.pdf
D.El.Ed. College List -Session 2024-26.pdf
 
0524.THOMASGIRARD_SINGLEPAGERESUME-01.pdf
0524.THOMASGIRARD_SINGLEPAGERESUME-01.pdf0524.THOMASGIRARD_SINGLEPAGERESUME-01.pdf
0524.THOMASGIRARD_SINGLEPAGERESUME-01.pdf
 

Version Control - Hem Shrestha

  • 1. Version Control Hem Kr. Shrestha Date: 3rd January, 2017
  • 2. Introduction to Version Control ● It is a component of Software Configuration Management ● It is also known as Revision Control or Source Control ● It is the management of changes to documents, programs, and other information stored as computer files ● It keeps track of every modification over time in a special kind of database
  • 3. Before Version Control ● File Renaming ○ Rename “Code.java” to “Code01.java” or “CodeDec25.java” ● Directory Renaming ○ Rename “src” folder to “src-2016Dec20” ● Zip File ○ Compress “MyProject” directory into “MyProject-2016Dec15.zip”
  • 4. Why Version Control ● Backup and Restore ● Collaboration ● Short-term undo ● Long-term undo ● Track Changes ● Track Ownership ● Branching and merging
  • 5. Software Versioning Types 1. Centralized version control system (CVCS) ○ Central server is dedicated host, like “master copy” ○ Stores files history and controls access to files. ○ This is kept separately from your working copy. ○ Eg. SVN 2. Distributed version control system (DVCS). ○ Every clone of repository is independent and act as full fledged system ○ Stows the entire history of project files into a special hidden folder inside the working copy on your hard drive. ○ Every commit gets added to the history in that hidden folder. ○ Eg. GIT, Mercurial, Bazaar
  • 6. Why Distributed Version Control ● Cheap local branches for easy experimentation ● History aware merges ● Full local history ● Offline commits ● To and fro revert back instantly ● Each working copy is a complete backup of the repository
  • 7. Version Control Concepts ● Repository - The database storing the files. ● Server - The computer storing the repo. ● Client - The computer connecting to the repo. ● Working set / Working copy - Your local directory of files, where you make changes. ● Trunk / Main - The primary location for code in the repo. ● Branch - Create a separate copy of a file/folder for private use ● Commit - Command to store that version with some message input ● Checkout and revert - Jump to specific commit or branch or tags
  • 8. Version Control Concepts contd... ● Merge - Apply the changes from one file to another, to bring it up-to-date. ● Conflict - When pending changes to a file contradict each other ● Resolve - Fixing the changes that contradict each other ● Tags - Static branch for storing a stable version ● Clone - Copy project to local from remote ● Push / Pull - send changes from local to remote or vice versa ● Logs - view the list of versions we have committed ● Diff - view changes within two points of commit or branches or tags ● Status - view local changes and files currently
  • 9. Version Control Best Practices ● Use Good comments ● Commit often ● Single and multi project repos ● Branch / Tag when appropriate ● Respect the repository trunk (master)
  • 10. Git Commands ● Git init ● Git add . ● Git status ● Git commit -m “first push” ● Git diff ● Git log ● Git remote add origin “http://origin.url” ● Git push origin master
  • 11. Git Online Repo Services ● Github.com ○ Public repo for free ○ Charges for private repo ● Bitbucket.org ○ Best for private repo ○ Charges for more than 5 user contributions ● Gitlab.com ○ Have both private as well as public repo
  • 13. References ● https://betterexplained.com/articles/a-visual-guide-to-version-control/ ● https://www.atlassian.com/git/tutorials/what-is-version-control/ ● https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control ● http://blog.hemshrestha.com.np/2013/12/11/startup-with-git-source-code-mana gement/