Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Introduction to Version Control
1. Introduction to Version Control
Wei-Tsung Su (蘇維宗)
ellington.su@gmail.com
04/01/2014 (Ver. 1.0)
Ubiquitous Computing and Ambient Networking Laboratory Page : 1
3. Agenda
• What is version control?
• Why use version control?
• Version control system (VCS)
– Types of VCS
– Terminologies of VCS
– Challenges of VCS
• Free VCS
– Web-based services
– Open source projects
Ubiquitous Computing and Ambient Networking Laboratory Page : 3
4. Version Control (or Revision Control)
• Version control is the management of changes to
documents, computer programs, large web sites,
and other collections of information. (Source:
Wikipedia)
• In version control, changes are usually identified
by a number termed as ”revision number”.
Ubiquitous Computing and Ambient Networking Laboratory Page : 4
5. Why use Version Control?
• Recall the previous versions
• Collaborative development environment
• Difference releases for a product by
– Different platforms
– Different customers
– …
Ubiquitous Computing and Ambient Networking Laboratory Page : 5
7. Scenarioscon’t
• Chicken and duck talk …
Ubiquitous Computing and Ambient Networking Laboratory Page : 7
void LOOPv1() {
for(;;);
}
Remove the for loop!
int LOOPv2() {
while(true);
}
for loop???
8. Scenarioscon’t
• Customers want customization …
Ubiquitous Computing and Ambient Networking Laboratory Page : 8
Ver 1.0 Ver 1.1_A
Ver 1.2_B
Ver 1.3_A
Customer A
Customer B
9. Version Control System
• Version control system (VCS) is a system that records
changes to a file or set of files over time so that you can
recall specific versions later. (Source: Git Pro)
• Type of VCS
– Local VCS (Ex. rcs)
– Centralized VCS (Ex. CVS, SVN)
– Distributed VCS (Ex. Git)
Ubiquitous Computing and Ambient Networking Laboratory Page : 9
10. Local VCS
Ubiquitous Computing and Ambient Networking Laboratory Page : 10
Local Computer
Version 3
Workspace Repository
Version 3
Version 2
Version 1
11. Centralized VCS
Ubiquitous Computing and Ambient Networking Laboratory Page : 11
VCS Server
Version 3
Workspace Repository
Version 3
Version 2
Version 1
Local Computer A
Version 3
Workspace
Local Computer B
12. Distributed VCS
Ubiquitous Computing and Ambient Networking Laboratory Page : 12
VCS Server
Repository
Version 3
Version 2
Version 1
Local Computer A
Repository
Version 3
Version 2
Version 1
Workspace
Version 3
Local Computer B
Repository
Version 3
Version 2
Version 1
Workspace
Version 3
13. Concepts of VCS
• Workspace and Repository
• Commit and Update
• Branch and Merge
Ubiquitous Computing and Ambient Networking Laboratory Page : 13
14. Workspace and Repository
• Workspace
– The working copy which developers could maintain in local
machines.
• Repository
– The controlled copies of different versions in VCS.
Ubiquitous Computing and Ambient Networking Laboratory Page : 14
VCS Server
Version 3
Workspace Repository
Version 3
Version 2
Version 1
Local Computer A
Version 3
Workspace
Local Computer B
15. Commit and Update
• Commit
– Write the changes made in the working copy back to the repository.
• Update
– Update changes made in the repository into the local working copy.
Ubiquitous Computing and Ambient Networking Laboratory Page : 15
Version 3 (modified)
Workspace Repository
Version 3
Version 2
Version 1
Version 41. Commit
Version 4
Workspace
2. Update
16. Branch and Merge
• Branch
– A set of files may be branched at a point in time so that, from that
time forward, two copies of those files may develop at different
speeds or in different ways independently of each other.
• Merge
– An operation in which two sets of changes are applied to a file or
set of files.
Ubiquitous Computing and Ambient Networking Laboratory Page : 16
Repository
Version 3Version 2Version 1
Version 4
MergeBranch
Version 5
17. Challenges of VCS
• Conflict
– A conflict occurs when different parties make changes to
the same document, and the system is unable to
reconcile the changes.
Ubiquitous Computing and Ambient Networking Laboratory Page : 17
Version 3 (modified)
Workspace Repository
Version 3
Version 2
Version 1
Version 4
(Conflict!!!)
Commit
Version 3 (modified)
Workspace
Commit
18. How to Prevent Conflicts?
• Modularize your projects
• Don’t commit generated files
• Integrate others’ changes frequently
• Share your changes frequently
• Test before commit
• …
Ubiquitous Computing and Ambient Networking Laboratory Page : 18