Introduction to Version Control

578 views

Published on

Published in: Engineering, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
578
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Introduction to Version Control

  1. 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
  2. 2. Reference • Scott Chacon, Git Pro, Jul. 29, 2009. Available: http://git-scm.com/book • http://en.wikipedia.org/wiki/Revision_control • http://homes.cs.washington.edu/~mernst/advic e/version-control.html Ubiquitous Computing and Ambient Networking Laboratory Page : 2
  3. 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. 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. 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
  6. 6. Scenarios • Sometimes, it happens … Ubiquitous Computing and Ambient Networking Laboratory Page : 6
  7. 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. 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. 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. 10. Local VCS Ubiquitous Computing and Ambient Networking Laboratory Page : 10 Local Computer Version 3 Workspace Repository Version 3 Version 2 Version 1
  11. 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. 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. 13. Concepts of VCS • Workspace and Repository • Commit and Update • Branch and Merge Ubiquitous Computing and Ambient Networking Laboratory Page : 13
  14. 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. 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. 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. 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. 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
  19. 19. Web-based VCS • GitHub – https://github.com/ • OpenFoundry – https://www.openfoundry.org/of/ • SourceForge – http://sourceforge.net/ • Google Code Project Hosting – https://code.google.com/ Ubiquitous Computing and Ambient Networking Laboratory Page : 19
  20. 20. Open Source Projects • Concurrent Versions System (CVS) • Subversion (SVN) – Apache Subversion Server – VisualSVN Server – TortoiseSVN Client – … • git-scm (software configuration management) Ubiquitous Computing and Ambient Networking Laboratory Page : 20
  21. 21. Q & A Ubiquitous Computing and Ambient Networking Laboratory Page : 21

×