Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Version Control & Git

5,623 views

Published on

A brief refresher of version control and an overview of Distributed Version Control and Git.

Published in: Technology

Version Control & Git

  1. 1. Version Control & Git Geoff Ford & Craig Smith Suncorp
  2. 2. According to Wikipedia: “… is the management of changes to documents, programs, and other information stored as computer files.” Image: http://i.ehow.com/images/GlobalPhoto/Articles/2065416/dictionary_Full.jpg
  3. 3. Before Version Control  File renaming Code.001 CodeNov1.xml  Directories Nov1Code  Zip files Nov1Code.zip  Nothing at all Image: http://www.stud.u-szeged.hu/Sajben.Emma/TW1128-Rock-Stars.jpg
  4. 4. We have moved on… haven’t we? Image http://yabadabadoo.files.wordpress.com/2008/03/puzzled-fred.jpg
  5. 5. A Brief History • diff • RVS DVCS Tool 1970’s • SCCS 1980’s • CVS 1990’s Support 2000’s (Bitkeeper, Git, etc…) Image http://www.free-background-wallpaper.com/images/Wallpapers1280/Beach-Wallpaper/Sand-Dunes-Soft.jpg
  6. 6. Version Control is…  Backup & restore  Synchronisation  Undo  Track changes  Sandbox / spike  Branch / merge  Not just for code Image http://globalnerdy.com/wordpress/wp-content/uploads/2007/10/version_control_star_trek_style.jpg
  7. 7. Check-in & Check-out
  8. 8. Branching & Merging
  9. 9. Subversion Setup Image http://blog.daemon.com.au/images/SourceImage/svnstructure.jpg
  10. 10. Version Control Best Practice  Use good comments  Commit often  Single vs multi project repos  Branch/tag when appropriate  Binaries/large files  Respect the trunk  Get to know your command line & client Image http://www.improvizations.com/Portals/42614/images//best- practice%20checklist-resized-600.jpg
  11. 11. • d Visualisation: FishEye/SVNStat
  12. 12. Traditonal / Centralised Version Control
  13. 13. Distributed Version Control
  14. 14. Hybrid Model Version Control
  15. 15. Why Distributed Version Control?  Cheap local branches for easy experimenting  History aware merges  Full local history  Offline commits  Each working copy is a complete backup of the repository
  16. 16. Example Distributed Version Control Tools  Git (2005) http://git-scm.com  Mercurial (2005) http://mercurial.selenic.com  Bazaar (2005) http://bazaar-vcs.org  Darcs (2004) http://darcs.net
  17. 17. Git is Fast
  18. 18. Git is Efficient
  19. 19. Git Workflow Clone git clone git://example.com/repo.git Working Branch git checkout -b new-feature Commit git add . git commit -m “Commit Message” Rebase & Merge git rebase master git checkout master git merge new-feature Push git push origin
  20. 20. Git + SVN Workflow Clone git svn clone http://example.com/repo Working Branch git checkout -b new-feature Commit git add . git commit -m “Commit Message” Rebase & Merge git rebase master git checkout master git merge new-feature Push to SVN git dcommit
  21. 21. Repository Many Branches
  22. 22. Many Branches + Merges
  23. 23. Live Demo
  24. 24. Want More Information? Geoff Ford geoff.ford@suncorp.com.au Craig Smith craig.smith@suncorp.com.au References:  http://www.spearce.org/2007/07/difficult-gitk- graphs.html  http://www.infoq.com/articles/dvcs-guide  http://ldn.linuxfoundation.org/article/dvcs-round-one- system-rule-them-all-part-3  http://gaveen.owain.org/2008/05/simple-diagram-on- distributed-vcs-hint.html  http://betterexplained.com/articles/a-visual-guide-to- version-control/  http://en.wikipedia.org/wiki/Revision_control

×