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 Uncontrolled!
How to Manage Your Version Control
Session 217
Tuesday, April 14,2015
3:15 - 4:15 pm
Room Banyan B
R...
Slide 2 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
About Me
 Harold Dost III @hdost
 6+ years of Oracle ...
Slide 3 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
About Raastech
 Small systems integrator founded in 20...
Slide 4 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Outline
1. Introduction
2. Version Control Systems
3. U...
Slide 5 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Slide 6 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Bias
 I am biased towards Git
 I have done my best to...
Slide 7 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Typical Large Corp Release Method
 Developer creates c...
Slide 8 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Where is the code?
 Often developer commits code to tr...
Slide 9 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Advantages
 Easy!
Slide 10 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Pitfalls
 Not Simple
 http://www.infoq.com/presentat...
Slide 11 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Slide 12 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Types of Version Control
 Centralized
 Distributed
Slide 13 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Centralized Version Control
 Relies on single reposit...
Slide 14 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Corporate Behavior: Centralized
 Merges are feared
 ...
Slide 15 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Centralized Version Control Software
Subversion (SVN)
...
Slide 16 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
SVN
 Initial Release in 2000
 An Apache Foundation P...
Slide 17 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Distributed Version Control
 Repositories are local
...
Slide 18 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Distributed Version Control Software
Bazaar
http://git...
Slide 19 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Git
 Started in 2005 by Linus Torvalds to support Lin...
Slide 20 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Using Git
Slide 21 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Slide 22 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Initialize a Repository
 In SVN:
 HOWTO: Hosting a S...
Slide 23 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
How to retrieve a repository
 In SVN:
 In Git:
svn c...
Slide 24 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
How to add files
 In SVN:
 In Git:
svn add test-file...
Slide 25 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
How to commit changes
 In SVN:
 In Git:
svn commit –...
Slide 26 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
How to push changes
 In SVN:
 Doesn’t make sense as ...
Slide 27 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
How to branch
 In SVN:
 In Git:
svn copy http://svn....
Slide 28 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
How to change branches
 In SVN:
 In Git:
cd path/to/...
Slide 29 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
How to merge
 In SVN:
 In Git:
cd /path/to/repo/trun...
Slide 30 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Slide 31 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Release Method 1: Environment Based
Development Test
P...
Slide 32 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Centralized Workflow
 Commits are sequential
 All us...
Slide 33 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Centralized Workflow (Cont.)
 Developer Checks out
 ...
Slide 34 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Feature Workflow
 Developers create branches for each...
Slide 35 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Feature Workflow (Cont.)
 Developer branches from mas...
Slide 36 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Release-based “Driessen” Workflow
 Two primary branch...
Slide 37 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Release-based Workflow (Cont.)
 Starts similar to fea...
Slide 38 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Slide 39 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Where?
 Where should deployments come from?
Slide 40 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
When?
 “Disclaimer about how established processes ma...
Slide 41 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Slide 42 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Purpose Driven Separation
 Branch Types
 Feature – “...
Slide 43 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Slide 44 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Finding Time
 Transition Slowly
 Implement portions ...
Slide 45 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Get Familiar With Tools and Process
 SVN Tutorials
 ...
Slide 46 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Perform an Exercise
 Go through a practice bug fix an...
Slide 47 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Introduce it at a team meeting
 This can be useful wh...
Slide 48 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Try process with a real change
 Be diligent about the...
Slide 49 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Do a team exercise
 If this exercise can show improve...
Slide 50 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Slide 51 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Contact Information
 Harold Dost III
 Senior Consult...
Slide 52 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
Resources
 Atlassian. (2015). Comparing Workflows. Re...
Upcoming SlideShare
Loading in …5
×

Version Uncontrolled - How to Manage Your Version Control

572 views

Published on

Are you constantly wondering what is in your production environment? Do you have any doubts about what code is running? Chances are that your version control software isn't the problem. No matter what system you're using there is the ideal and there is the practice. This session is one that will help you get on the right track. Topics covered include: the types of version control systems, merging and branching techniques, and methods to get a solid source control workflow into place. We will also talk about organization of version control and how that can help with enhancing confidence in your code base.

Published in: Technology
  • Be the first to comment

Version Uncontrolled - How to Manage Your Version Control

  1. 1. Version Uncontrolled! How to Manage Your Version Control Session 217 Tuesday, April 14,2015 3:15 - 4:15 pm Room Banyan B Raastech, Inc. 2201 Cooperative Way, Suite 600 Herndon, VA 20171 +1-703-884-2223 info@raastech.com
  2. 2. Slide 2 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech About Me  Harold Dost III @hdost  6+ years of Oracle Middleware experience  OCE (SOA Foundation Practitioner)  Oracle ACE Associate  From Michigan  blog.raastech.com
  3. 3. Slide 3 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech About Raastech  Small systems integrator founded in 2009  Headquartered in the Washington DC area  Specializes in Oracle Fusion Middleware  Oracle Platinum Partner & Reseller  Oracle SOA Specialized  100% of consultants are Oracle certified  100% of consultants present at major Oracle conferences  100% of consultants have published books, whitepapers, or articles  Oracle SOA Specialized – 1 in 1,500 worldwide  Oracle Platinum Partner – 1 in 3,000 worldwide
  4. 4. Slide 4 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Outline 1. Introduction 2. Version Control Systems 3. Useful Version Control Commands 4. Workflows 5. The Deployment Cycle 6. Branching 7. Getting Your Team On Board 8. Questions & Answers
  5. 5. Slide 5 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
  6. 6. Slide 6 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Bias  I am biased towards Git  I have done my best to be neutral Git Factoids  Git is a distributed revision control system with an emphasis on speed, data integrity, and support for distributed, non-linear workflows.  Git was initially designed and developed by Linus Torvalds for Linux kernel development in 2005  Git is the most widely adopted version control system for software development.  Git is freely distributed under the terms of the GNU General Public License v2.
  7. 7. Slide 7 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Typical Large Corp Release Method  Developer creates code  Developer unit tests code  Code may get tested by 3rd party  Code may get reviewed by 3rd party  Code may get tested in a secondary environment to ensure setups are correct  Code gets deployed to Production  Spot checks may be done
  8. 8. Slide 8 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Where is the code?  Often developer commits code to trunk repeatedly
  9. 9. Slide 9 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Advantages  Easy!
  10. 10. Slide 10 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Pitfalls  Not Simple  http://www.infoq.com/presentations/Simple-Made-Easy  http://www.slideshare.net/evandrix/simple-made-easy  Need people to remember or record in a tool which code version is to be deployed  After deployment version may be all but lost  Could have tools in place, but those require additional maintenance  Places tracking outside of developer responsibility
  11. 11. Slide 11 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
  12. 12. Slide 12 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Types of Version Control  Centralized  Distributed
  13. 13. Slide 13 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Centralized Version Control  Relies on single repository  People check-out and check-in documents  Some locking may be used to prevent conflicts  Branches treated like folders Repository Curly Larry Moe
  14. 14. Slide 14 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Corporate Behavior: Centralized  Merges are feared  Tendency towards committing only when absolutely necessary  Commits to trunk/master for everything
  15. 15. Slide 15 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Centralized Version Control Software Subversion (SVN) http://subversion.tigris.org Team Foundation Server (TFS) https://msdn.microsoft.com/en-us/vstudio/ff637362.aspx Concurrent Versioning System (CVS) http://www.nongnu.org/cvs/ Perforce(P4) http://www.perforce.com ClearCase http://www-03.ibm.com/software/products/en/clearcase
  16. 16. Slide 16 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech SVN  Initial Release in 2000  An Apache Foundation Project  Mostly compatible successor to CVS
  17. 17. Slide 17 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Distributed Version Control  Repositories are local  Peer-to-Peer  Exchange Patches  Branches are separate entity Joe Curly Moe “Blessed” Repo
  18. 18. Slide 18 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Distributed Version Control Software Bazaar http://git-scm.com/
  19. 19. Slide 19 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Git  Started in 2005 by Linus Torvalds to support Linux Kernel Development  Inspired by BitKeeper and Monotone
  20. 20. Slide 20 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Using Git
  21. 21. Slide 21 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
  22. 22. Slide 22 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Initialize a Repository  In SVN:  HOWTO: Hosting a Subversion Repository  http://queens.db.toronto.edu/~nilesh/linux/subversion-howto/  In Git:  https://kovshenin.com/2011/howto-remote-shared-git-repository/ git init -OR- git init –bare test-repo.git
  23. 23. Slide 23 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech How to retrieve a repository  In SVN:  In Git: svn co https://host.com/path/repo git clone https://host.com/path/repo.git -OR- git clone user@server:path/repo.git
  24. 24. Slide 24 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech How to add files  In SVN:  In Git: svn add test-file.txt git add test-file.txt
  25. 25. Slide 25 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech How to commit changes  In SVN:  In Git: svn commit –m "Some Message" git commit –m "Some Message"
  26. 26. Slide 26 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech How to push changes  In SVN:  Doesn’t make sense as it’s not distributed  In Git: git push
  27. 27. Slide 27 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech How to branch  In SVN:  In Git: svn copy http://svn.example.com/repos/calc/trunk http://svn.example.com/repos/calc/branches/my-calc-branch -m "Creating a private branch of /calc/trunk." git branch my-calc-branch -OR- git checkout –b my-calc-branch # Takes you to the new branch
  28. 28. Slide 28 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech How to change branches  In SVN:  In Git: cd path/to/branch git checkout my-calc-branch
  29. 29. Slide 29 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech How to merge  In SVN:  In Git: cd /path/to/repo/trunk svn merge ../branches/my_branch/ # Merges changes in working copy svn commit -m "Merge my_branch" cd /path/to/repo git merge my-branch # Merges Local Branches git push # Pushes merge out to remote
  30. 30. Slide 30 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
  31. 31. Slide 31 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Release Method 1: Environment Based Development Test Production (trunk) F2 F3F1
  32. 32. Slide 32 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Centralized Workflow  Commits are sequential  All users commit to the same branch  No guarantee of what is “production- ready”  Tagging not very useful
  33. 33. Slide 33 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Centralized Workflow (Cont.)  Developer Checks out  Makes Changes  Commits  Some point in the future code ends up in development
  34. 34. Slide 34 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Feature Workflow  Developers create branches for each feature  Features don’t get merged until it’s time for production
  35. 35. Slide 35 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Feature Workflow (Cont.)  Developer branches from master/trunk  Makes changes
  36. 36. Slide 36 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Release-based “Driessen” Workflow  Two primary branches  Production  Development  Transient Personal Branches  Tagging Used Heavily  Manages for Hot Fixes  Release Branches Credit Vincent Driessen
  37. 37. Slide 37 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Release-based Workflow (Cont.)  Starts similar to feature workflow  Features branches from develop  Hotfixes from master  Upon feature completion, merged back into develop  Once ready to do a release create a branch  Only perform bug fixes  Release to production/master
  38. 38. Slide 38 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
  39. 39. Slide 39 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Where?  Where should deployments come from?
  40. 40. Slide 40 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech When?  “Disclaimer about how established processes may prevent changing the timing and the effects of testing on this.”  How often should I release?  When during the day should I release?
  41. 41. Slide 41 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
  42. 42. Slide 42 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Purpose Driven Separation  Branch Types  Feature – “feature/HAD/00001-some-new-feature”  Bug – “bug/HAD/010000-blue-screen-of-death-is-red”  Spike / Experimental  “spike/HAD/radical-new-things”  “exp/HAD/something-really-awesome”  Release – “release/1.5” or “release/20150507.1”  Tagging – “1.4” or “20150808.1”
  43. 43. Slide 43 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
  44. 44. Slide 44 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Finding Time  Transition Slowly  Implement portions where possible  Start with keeping all new development into separate
  45. 45. Slide 45 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Get Familiar With Tools and Process  SVN Tutorials  http://www.tutorialspoint.com/svn/  GIT Book  http://git-scm.com/book/en/v2/
  46. 46. Slide 46 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Perform an Exercise  Go through a practice bug fix and feature release.  Create Branches  Make gimmick changes  Go through the steps of a release  Code Change  Code Review  Release and merge
  47. 47. Slide 47 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Introduce it at a team meeting  This can be useful whether or not the release process is decided at a team level.
  48. 48. Slide 48 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Try process with a real change  Be diligent about the process  Follow it to production  Review the hiccups and try to iron them out.  Slowly add it to more changes.
  49. 49. Slide 49 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Do a team exercise  If this exercise can show improved efficiency and code quality
  50. 50. Slide 50 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech
  51. 51. Slide 51 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Contact Information  Harold Dost III  Senior Consultant  @hdost  harold.dost@raastech.com
  52. 52. Slide 52 of 53© Raastech, Inc. 2015 | All rights reserved.@Raastech Resources  Atlassian. (2015). Comparing Workflows. Retrieved 2015, from Atlassian: https://www.atlassian.com/git/tutorials/comparing-workflows/  Bansal, N. (2011). HOWTO: Hosting a Subversion Repository. Retrieved 2015, from University Of Toronto: http://queens.db.toronto.edu/~nilesh/linux/subversion-howto/  Driessen, V. (2010). A successful Git branching model. Retrieved 2015, from Nvie: http://nvie.com/posts/a-successful-git-branching-model/  Git SCM. (2014). Git Book. Retrieved 2015, from Git SCM: http://git- scm.com/book/en/v2/  Kovshenin, K. (2011). How To Create a Remote Shared Git Repository. Retrieved 2015, from Kovshenin: https://kovshenin.com/2011/howto-remote- shared-git-repository/  Tutorials Point. (2014). SVN Tutorial. Retrieved 2015, from Tutorials Point: http://www.tutorialspoint.com/svn/

×