SlideShare a Scribd company logo
1 of 32
Download to read offline
Versioning
System
Overview
Instructor:
Muhammad Shahzad Mughal
Course:
System Programming
Punjab University
College of InformationTechnology
University ofThe Punjab
2
Topics of this session
• Introduction toVersion Control
• Types of Revision Control Systems
• Local Data Model (sccs, rcs)
• Centralized Data Model (cvs, svn)
• Distributed Data Model (bitkeeper, git, mercurial, darcs)
• Downloading, installing and configuring git
• Working with git
• Initializing a git repository
• Adding and committing files to git repository
• Viewing logs and status
• Deleting, renaming and comparing files
• Ignoring files
• Undoing changes and moving to old commits
Version Control System
• A Version Control System is a software tool that records changes to a file or a set of
files over time, so that you can recall specific versions later
• Before VCSs exists we used different ways for maintaining versions of file(s) e.g.
using save as for every new change made to file and making a copy and then giving a
version number and date of update to that file
• AVCS allows us to
 Maintain a history of different versions of a file
 To move back and forth between these versions
 Compare different versions
 Merge multiple versions of same file to create a new version
 Lock other users when one user is altering a file
 Conflict resolution
Types of
Version Control Systems
(VCSs)
1. Local Data Model
Local Data Model
Local Computer
File
Version Database
File.Version3
File.Version2
File.Version1
Source Code Control System: (SCCS-1972)
• Written in C, developed by AT&T and bundled free with UNIX
• It was not the firstVCS, rather the first to become popular
• SCCS keeps the original file as-it-is and instead of saving the
complete new version just save the snapshot of the changes
• If you want ver.3 of a file, you take ver.1 of the file and apply
two set of changes to it to get to ver.3
Local Data Model …
Revision Control System: (RCS-1982)
• Written in C, developed at Purdue University
• SCCS was for UNIX only, while RCS was for PCs as well
• RCS keeps the most recent version of a file in its whole form
and if you want a previous version, you apply changes history
to the latest version to re-create the older version
• This is faster than SCCS, as most of the time we need to work
with the latest version of the file
Local Data Model …
Limitations of LocalVCSs:
• You can track changes in a single file and not in a set of files or
in a whole project
• Only one user can work with a file at a single time, therefore,
multiple users / team members cannot collaborate and work
on the same project
Local Data Model …
2. Centralized Data Model
Centralized Data Model
Central CVS Server
File Version Database
(Repository)
File.Version3
File.Version2
File.Version1
Computer A
File
Computer B
ConcurrentVersion System: (CVS-1990)
• Written in C and is open source
• Available for UNIX like OSs (UNIX, Linux, Solaris) as well as for MS
Windows
• Introduced the idea of branching. A set of files may be branched at a
point in time so that, from that time onward, two copies of those files
may be developed in different ways independently of each other
Limitations
• CVS lacks atomic operations. Uses lock-modify-unlock model, allowing a
user to place a lock on the checkout data in the repository, avoiding
concurrency problems
• No file renaming as cannot track directories
Centralized Data Model …
Apache Subversion System: (SVN-2000)
• Written in C, and is open source
• Cross platform and is faster than CVS
• Supports atomic commits
• Can track directories, so you can rename files within directories
• It can also track non-text files like images
Centralized Data Model …
Limitations of CentralizedVCSs:
• Single point of failure as the centralized server containing the
version database may crash
• No collaboration if server is down
• Developers do not have history of project on their local machines
Centralized Data Model …
3. Distributed Data Model
Distributed Data Model
Server Computer
Version Database
File.Version3
File.Version2
File.Version1
Computer B
Version Database
File.Version3
File.Version2
File.Version1
Computer A
Version Database
File.Version3
File.Version2
File.Version1
Bitkeeper -2000
• Written in C, and is proprietary and closed source
• A community version of bitkeeper with limited functionalities was
free and that was used to manage Linux Kernel source from 2002
to 2005
• In April 2005, the “community version of bitkeeper” stopped
being free and it was then git was born
Distributed Data Model …
git - 2005
• Developed by LinuxTorvald in 2005,
• git is free and open source distributed version control system designed to handle
everything from small to very large projects with speed and efficiency
• It is compatible with all UNIX-like systems (Linux, MacOS, Solaris, PCBSD, …) and MS
Windows
• It is written mainly in C along with:
 TCL: A general purpose interpreted dynamic programming language, which is
embedded into C programs for rapid prototyping
 Perl: A general purpose interpreted dynamic programming language and is popular
for its string parsing abilities
 Python: A general purpose interpreted dynamic programming language and supports
multiple programming paradigms like procedural, object oriented, imperative and
functional
Distributed Data Model …
git
Installation & Configuration
git => git.scm.com
git => git.scm.com (downloads)
git => git.scm.com (GUI Clients)
23
• $ sudo apt-get install git
• $ git –version
• $ which git
• $ git help
• $ man git
• $ git help tutorial
• $ git help everyday {basic useful commands}
Download and install git
24
• git has three basis on which git perform configurations
– System configurations
• Applied to all users on the current system
• Stored in /etc/gitconfig
– Per user configurations
• Stored in ~/gitconfig
• Initially there would be no such file on the system
• This file will exist for each user
– Project configurations
• Stored in gitconfig files exist in git directory of each project
git configurations
25
● We can edit these files directly
● Better to use config tool
● different configurations
–$ git config --system {for system configuration}
–$ git config --global {for per user configurations}
–$ git config --local {for project level configurations}
git configurations …
26
• There are minimum two configurations required by git
– user.name
• $ git config --global user.name “MShahzad”
– user.email
• $ git config --global user.email “muhammad.shahzad@pucit.edu.pk”
• To view these configurations
– $ git config --global --list
git configurations …
BasicWorkflow of git
Working
Directory
Staging
Index
Local
Repository
git init
git add
git commit
 Suppose you have made three commits in your project, that means there are
three change sets.
 Each commit object refers to a change set.
 Following figure illustrates how the series of commits are linked together. Note
that the parent of each refers to a previous commit.
 We can see who has committed, when, why and with what change
The commit Objects
231a5...
Parent: nil
Author: Ahmad
Msg: initial commit
Timestamps: ...
5ac27...
Parent: 231a5
Author: Ahmad
Msg: 2nd commit
Timestamps: ...
1e3f5...
Parent: 5ac27...
Author: Ahmad
Msg: 3rd commit
Timestamps: ...
Change Set A Change Set B Change Set C
HEAD Pointer in git
25a76
HEAD
25a76
HEAD
25a76
HEAD
25a76
36a2c
36a2c
36a2c
f1d43
f1d43 f1d43
HEAD
Life-cycle of a file in git
untracked unmodified modified staged
Edit the file
stage the file
commit
add the file
remove the file
We can move the head pointer to some previous commit and start recording the
commits from that commit object onwards. There are three ways of doing this
Soft Reset: $ git reset --soft <ID>
• Head is moved to the specified commit ID
• No changes are made in the staging index or working directory
Mixed Reset: $ git reset --mixed <ID>
• Head is moved to the specified commit ID
• Staging index is also changed to match the local repository
• No changes are made in the working directory
Hard Reset: $ git reset --hard <ID>
• Head is moved to the specified commit IDStaging index and working directory both
match the local repository
Move to an old commit
ThankYou !!!

More Related Content

What's hot

Synchronization
SynchronizationSynchronization
Synchronizationmisra121
 
The sysfs Filesystem
The sysfs FilesystemThe sysfs Filesystem
The sysfs FilesystemJeff Yana
 
Linux Performance Tunning Kernel
Linux Performance Tunning KernelLinux Performance Tunning Kernel
Linux Performance Tunning KernelShay Cohen
 
Kernel Recipes 2016 - Would an ABI changes visualization tool be useful to Li...
Kernel Recipes 2016 - Would an ABI changes visualization tool be useful to Li...Kernel Recipes 2016 - Would an ABI changes visualization tool be useful to Li...
Kernel Recipes 2016 - Would an ABI changes visualization tool be useful to Li...Anne Nicolas
 
Presentation on nfs,afs,vfs
Presentation on nfs,afs,vfsPresentation on nfs,afs,vfs
Presentation on nfs,afs,vfsPrakriti Dubey
 
Using Subversion and Git Together
Using Subversion and Git TogetherUsing Subversion and Git Together
Using Subversion and Git Togethertmatesoftware
 
File service architecture and network file system
File service architecture and network file systemFile service architecture and network file system
File service architecture and network file systemSukhman Kaur
 
FOSDEM2015: Live migration for containers is around the corner
FOSDEM2015: Live migration for containers is around the cornerFOSDEM2015: Live migration for containers is around the corner
FOSDEM2015: Live migration for containers is around the cornerAndrey Vagin
 
Google file system GFS
Google file system GFSGoogle file system GFS
Google file system GFSzihad164
 
Live migration: pros, cons and gotchas -- Pavel Emelyanov
Live migration: pros, cons and gotchas -- Pavel EmelyanovLive migration: pros, cons and gotchas -- Pavel Emelyanov
Live migration: pros, cons and gotchas -- Pavel EmelyanovOpenVZ
 
Git walkthrough
Git walkthroughGit walkthrough
Git walkthroughBimal Jain
 
Google file system
Google file systemGoogle file system
Google file systemDhan V Sagar
 
4.file service architecture (1)
4.file service architecture (1)4.file service architecture (1)
4.file service architecture (1)AbDul ThaYyal
 
3. distributed file system requirements
3. distributed file system requirements3. distributed file system requirements
3. distributed file system requirementsAbDul ThaYyal
 

What's hot (20)

Synchronization
SynchronizationSynchronization
Synchronization
 
Andrew File System
Andrew File SystemAndrew File System
Andrew File System
 
The sysfs Filesystem
The sysfs FilesystemThe sysfs Filesystem
The sysfs Filesystem
 
Introduction To SVN
Introduction To SVNIntroduction To SVN
Introduction To SVN
 
Introduction To SVN
Introduction To SVNIntroduction To SVN
Introduction To SVN
 
Linux Performance Tunning Kernel
Linux Performance Tunning KernelLinux Performance Tunning Kernel
Linux Performance Tunning Kernel
 
Kernel Recipes 2016 - Would an ABI changes visualization tool be useful to Li...
Kernel Recipes 2016 - Would an ABI changes visualization tool be useful to Li...Kernel Recipes 2016 - Would an ABI changes visualization tool be useful to Li...
Kernel Recipes 2016 - Would an ABI changes visualization tool be useful to Li...
 
Presentation on nfs,afs,vfs
Presentation on nfs,afs,vfsPresentation on nfs,afs,vfs
Presentation on nfs,afs,vfs
 
Google file system
Google file systemGoogle file system
Google file system
 
Using Subversion and Git Together
Using Subversion and Git TogetherUsing Subversion and Git Together
Using Subversion and Git Together
 
Unit 7
Unit 7Unit 7
Unit 7
 
File service architecture and network file system
File service architecture and network file systemFile service architecture and network file system
File service architecture and network file system
 
FOSDEM2015: Live migration for containers is around the corner
FOSDEM2015: Live migration for containers is around the cornerFOSDEM2015: Live migration for containers is around the corner
FOSDEM2015: Live migration for containers is around the corner
 
Google file system GFS
Google file system GFSGoogle file system GFS
Google file system GFS
 
Live migration: pros, cons and gotchas -- Pavel Emelyanov
Live migration: pros, cons and gotchas -- Pavel EmelyanovLive migration: pros, cons and gotchas -- Pavel Emelyanov
Live migration: pros, cons and gotchas -- Pavel Emelyanov
 
Git walkthrough
Git walkthroughGit walkthrough
Git walkthrough
 
Google file system
Google file systemGoogle file system
Google file system
 
4.file service architecture (1)
4.file service architecture (1)4.file service architecture (1)
4.file service architecture (1)
 
3. distributed file system requirements
3. distributed file system requirements3. distributed file system requirements
3. distributed file system requirements
 
Coda file system tahir
Coda file system   tahirCoda file system   tahir
Coda file system tahir
 

Similar to L06 a versioning_system_overview

Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Gitatishgoswami
 
Version control with GIT
Version control with GITVersion control with GIT
Version control with GITZeeshan Khan
 
Presentation for git jira and linux
Presentation for git jira and linuxPresentation for git jira and linux
Presentation for git jira and linuxdkylko1
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITPouriaQashqai1
 
Introduction to Version Control
Introduction to Version ControlIntroduction to Version Control
Introduction to Version ControlWei-Tsung Su
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github Max Claus Nunes
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with GitSahil Agarwal
 
Version Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part IVersion Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part ISergey Aganezov
 
Hands on kubernetes_container_orchestration
Hands on kubernetes_container_orchestrationHands on kubernetes_container_orchestration
Hands on kubernetes_container_orchestrationAmir Hossein Sorouri
 
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Ahmed El-Arabawy
 
Source code version control and git
Source code version control and git Source code version control and git
Source code version control and git Naseer Khan Noor
 

Similar to L06 a versioning_system_overview (20)

Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Mini git tutorial
Mini git tutorialMini git tutorial
Mini git tutorial
 
Version control with GIT
Version control with GITVersion control with GIT
Version control with GIT
 
Presentation for git jira and linux
Presentation for git jira and linuxPresentation for git jira and linux
Presentation for git jira and linux
 
Git 101
Git 101Git 101
Git 101
 
CSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GITCSE 390 Lecture 9 - Version Control with GIT
CSE 390 Lecture 9 - Version Control with GIT
 
GIT INTRODUCTION
GIT INTRODUCTIONGIT INTRODUCTION
GIT INTRODUCTION
 
Introduction to Version Control
Introduction to Version ControlIntroduction to Version Control
Introduction to Version Control
 
Git hub
Git hubGit hub
Git hub
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
 
Git
GitGit
Git
 
Git basics
Git basicsGit basics
Git basics
 
Migrating To GitHub
Migrating To GitHub  Migrating To GitHub
Migrating To GitHub
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with Git
 
Version Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part IVersion Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part I
 
Hands on kubernetes_container_orchestration
Hands on kubernetes_container_orchestrationHands on kubernetes_container_orchestration
Hands on kubernetes_container_orchestration
 
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
 
Source code version control and git
Source code version control and git Source code version control and git
Source code version control and git
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
git.ppt.pdf
git.ppt.pdfgit.ppt.pdf
git.ppt.pdf
 

Recently uploaded

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 

Recently uploaded (20)

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 

L06 a versioning_system_overview

  • 1. Versioning System Overview Instructor: Muhammad Shahzad Mughal Course: System Programming Punjab University College of InformationTechnology University ofThe Punjab
  • 2. 2 Topics of this session • Introduction toVersion Control • Types of Revision Control Systems • Local Data Model (sccs, rcs) • Centralized Data Model (cvs, svn) • Distributed Data Model (bitkeeper, git, mercurial, darcs) • Downloading, installing and configuring git • Working with git • Initializing a git repository • Adding and committing files to git repository • Viewing logs and status • Deleting, renaming and comparing files • Ignoring files • Undoing changes and moving to old commits
  • 3. Version Control System • A Version Control System is a software tool that records changes to a file or a set of files over time, so that you can recall specific versions later • Before VCSs exists we used different ways for maintaining versions of file(s) e.g. using save as for every new change made to file and making a copy and then giving a version number and date of update to that file • AVCS allows us to  Maintain a history of different versions of a file  To move back and forth between these versions  Compare different versions  Merge multiple versions of same file to create a new version  Lock other users when one user is altering a file  Conflict resolution
  • 4. Types of Version Control Systems (VCSs)
  • 6. Local Data Model Local Computer File Version Database File.Version3 File.Version2 File.Version1
  • 7. Source Code Control System: (SCCS-1972) • Written in C, developed by AT&T and bundled free with UNIX • It was not the firstVCS, rather the first to become popular • SCCS keeps the original file as-it-is and instead of saving the complete new version just save the snapshot of the changes • If you want ver.3 of a file, you take ver.1 of the file and apply two set of changes to it to get to ver.3 Local Data Model …
  • 8. Revision Control System: (RCS-1982) • Written in C, developed at Purdue University • SCCS was for UNIX only, while RCS was for PCs as well • RCS keeps the most recent version of a file in its whole form and if you want a previous version, you apply changes history to the latest version to re-create the older version • This is faster than SCCS, as most of the time we need to work with the latest version of the file Local Data Model …
  • 9. Limitations of LocalVCSs: • You can track changes in a single file and not in a set of files or in a whole project • Only one user can work with a file at a single time, therefore, multiple users / team members cannot collaborate and work on the same project Local Data Model …
  • 11. Centralized Data Model Central CVS Server File Version Database (Repository) File.Version3 File.Version2 File.Version1 Computer A File Computer B
  • 12. ConcurrentVersion System: (CVS-1990) • Written in C and is open source • Available for UNIX like OSs (UNIX, Linux, Solaris) as well as for MS Windows • Introduced the idea of branching. A set of files may be branched at a point in time so that, from that time onward, two copies of those files may be developed in different ways independently of each other Limitations • CVS lacks atomic operations. Uses lock-modify-unlock model, allowing a user to place a lock on the checkout data in the repository, avoiding concurrency problems • No file renaming as cannot track directories Centralized Data Model …
  • 13. Apache Subversion System: (SVN-2000) • Written in C, and is open source • Cross platform and is faster than CVS • Supports atomic commits • Can track directories, so you can rename files within directories • It can also track non-text files like images Centralized Data Model …
  • 14. Limitations of CentralizedVCSs: • Single point of failure as the centralized server containing the version database may crash • No collaboration if server is down • Developers do not have history of project on their local machines Centralized Data Model …
  • 16. Distributed Data Model Server Computer Version Database File.Version3 File.Version2 File.Version1 Computer B Version Database File.Version3 File.Version2 File.Version1 Computer A Version Database File.Version3 File.Version2 File.Version1
  • 17. Bitkeeper -2000 • Written in C, and is proprietary and closed source • A community version of bitkeeper with limited functionalities was free and that was used to manage Linux Kernel source from 2002 to 2005 • In April 2005, the “community version of bitkeeper” stopped being free and it was then git was born Distributed Data Model …
  • 18. git - 2005 • Developed by LinuxTorvald in 2005, • git is free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency • It is compatible with all UNIX-like systems (Linux, MacOS, Solaris, PCBSD, …) and MS Windows • It is written mainly in C along with:  TCL: A general purpose interpreted dynamic programming language, which is embedded into C programs for rapid prototyping  Perl: A general purpose interpreted dynamic programming language and is popular for its string parsing abilities  Python: A general purpose interpreted dynamic programming language and supports multiple programming paradigms like procedural, object oriented, imperative and functional Distributed Data Model …
  • 21. git => git.scm.com (downloads)
  • 22. git => git.scm.com (GUI Clients)
  • 23. 23 • $ sudo apt-get install git • $ git –version • $ which git • $ git help • $ man git • $ git help tutorial • $ git help everyday {basic useful commands} Download and install git
  • 24. 24 • git has three basis on which git perform configurations – System configurations • Applied to all users on the current system • Stored in /etc/gitconfig – Per user configurations • Stored in ~/gitconfig • Initially there would be no such file on the system • This file will exist for each user – Project configurations • Stored in gitconfig files exist in git directory of each project git configurations
  • 25. 25 ● We can edit these files directly ● Better to use config tool ● different configurations –$ git config --system {for system configuration} –$ git config --global {for per user configurations} –$ git config --local {for project level configurations} git configurations …
  • 26. 26 • There are minimum two configurations required by git – user.name • $ git config --global user.name “MShahzad” – user.email • $ git config --global user.email “muhammad.shahzad@pucit.edu.pk” • To view these configurations – $ git config --global --list git configurations …
  • 28.  Suppose you have made three commits in your project, that means there are three change sets.  Each commit object refers to a change set.  Following figure illustrates how the series of commits are linked together. Note that the parent of each refers to a previous commit.  We can see who has committed, when, why and with what change The commit Objects 231a5... Parent: nil Author: Ahmad Msg: initial commit Timestamps: ... 5ac27... Parent: 231a5 Author: Ahmad Msg: 2nd commit Timestamps: ... 1e3f5... Parent: 5ac27... Author: Ahmad Msg: 3rd commit Timestamps: ... Change Set A Change Set B Change Set C
  • 29. HEAD Pointer in git 25a76 HEAD 25a76 HEAD 25a76 HEAD 25a76 36a2c 36a2c 36a2c f1d43 f1d43 f1d43 HEAD
  • 30. Life-cycle of a file in git untracked unmodified modified staged Edit the file stage the file commit add the file remove the file
  • 31. We can move the head pointer to some previous commit and start recording the commits from that commit object onwards. There are three ways of doing this Soft Reset: $ git reset --soft <ID> • Head is moved to the specified commit ID • No changes are made in the staging index or working directory Mixed Reset: $ git reset --mixed <ID> • Head is moved to the specified commit ID • Staging index is also changed to match the local repository • No changes are made in the working directory Hard Reset: $ git reset --hard <ID> • Head is moved to the specified commit IDStaging index and working directory both match the local repository Move to an old commit