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.
Source Control 101<br />
What are we doing?<br />Introduction<br />Lab 1<br /><ul><li>The file sharing way
Review</li></ul>Lab 2<br /><ul><li>Create repo, check in & check out
Review</li></ul>Lab 3<br /><ul><li>Sync & Rollback
Review</li></ul>Lab 4<br /><ul><li>Conflict management
Review</li></ul>Lab 5<br /><ul><li>Locks & Revert
Review</li></ul>Lab 6<br /><ul><li>Branching
Review</li></ul>Lab 7<br /><ul><li>Merging
Review</li></ul>Alternatives to SVN<br />Other TortoiseSVN Tools<br />IDE Integration<br />Proven Practises<br />
Disclaimer<br />The names and scenarios presented here are purely fictional. Any similarity to real people or scenarios is...
Time to get a little crazy<br />You need to be three people today<br />Jim, the junior software dev.<br />Just out of his ...
Supporting cast<br />The wizard – fly’s in and does magic!<br />(used for stuff you need, but don’t care about)<br />The c...
Create a file share and do some changes.<br />Time: 5min<br />
Now...<br />The customer needs a bug fixed in version 1<br />
What’s in a Name?<br />
What is source control?<br />An agreed way to share development resources that gives us:<br />
Terminology<br />
Branching Terminology<br />
Basic Action Terminology<br />
Basic Action Terminology<br />
Mike: Create a repo<br />Simon: Check in a file<br />Jim: Get a file<br />Time: 5min<br />
Lab 2 - Review<br />Repo<br />DAL.txt<br />v1<br />Add<br />Get<br />DAL.txt<br />v1<br />
Lab 2 - Review<br />Is this how you should do your repo?<br />	No, use the TCP/IP or SVN protocol.<br />What is TortoiseSV...
Jim: Update the file & check it in.<br />Simon: Sync and rollback.<br />Time: 5min<br />
Lab 3 - Review<br />DAL.txt<br />v2<br />DAL.txt<br />v1<br />Update<br />Repo<br />Sync<br />Again<br />DAL.txt<br />v2<b...
Lab 3 - Review<br />Why did we have to commit again?<br />	Because there was a change<br />What revision are we now on?<br...
Jim: Change the file<br />Simon: Change the file<br />CONFLICT!!<br />Time: 10min<br />
Lab 4 - Review<br />DAL.txt<br />v3<br />DAL.txt<br />v4b<br />DAL.txt<br />v5<br />Repo<br />Sync<br />Sync<br />Update<b...
Lab 4 - Review<br />Why did we have a .r3 and .r4 file?<br />	revision 3 & revision 4<br />What would happen if this was t...
Simon: wants to do a major code change and make sure Jim doesn’t mess with him<br />Time: 5min<br />
Lab 5 - Review<br />DAL.txt<br />v5<br />Sync<br />Repo<br />Lock<br />Sync<br />DAL.txt<br />
Lab 5 - Review<br />Who locked the file?<br />	Developer, the user logged into Windows<br />What happens if the person who...
Simon: As they are releasing version 1 they want to make sure they can fix issues while working on v2.<br />Time: 10min<br />
Lab 6 - Review<br />Trunk<br />Repo<br />Trunk<br />V1 Branch<br />Branch<br />
Lab 6 - Review<br />Do we need to switch?<br />	No, but it helps keep focus and prevent issues across branches.<br />
Lab 6 - Review<br />What is shelving?<br />Shelving is branching to a personal temporary branch.<br />Why shelve?<br />Int...
Lab 6 - Review<br />How to shelve?<br />Create a new root folder named shelve, as we did for branches.<br />In that a fold...
Lab 6 - Review<br />Which is correct?<br />V1.1 (start)<br />V1.2<br />V1.1 (start)<br />V1.1 FT3<br />DEV<br />DEV<br />3...
Scenario #1: Single Team Branching Model<br />Nightly Build<br />(Early Validation)<br />All dev done on branch<br />CI / ...
Scenario #2: Concurrent Hot Fix, Service Pack, and v.Next<br />2<br />DEV …<br />The two DEV branches are created as seque...
Scenario #3: Branching and Labeling<br />The two DEV branches are created as sequential tasks, but as one unit of work.<br...
Simon: Needs to make sure v2 gets the same bug fix as v1 had.<br />Time: 5min<br />
Lab 7 - Review<br />Branch v1<br />Conflict<br />Merge<br />Trunk<br />No cartoons, cause this is too hard to show with ca...
Other TortoiseSVN tools <br />
Upcoming SlideShare
Loading in …5
×

Source Control 101

1,797 views

Published on

My brief introductory training on using source control. SubVersion was used during the presentation but it applies to most source control systems.

Published in: Technology
  • Be the first to comment

Source Control 101

  1. 1. Source Control 101<br />
  2. 2. What are we doing?<br />Introduction<br />Lab 1<br /><ul><li>The file sharing way
  3. 3. Review</li></ul>Lab 2<br /><ul><li>Create repo, check in & check out
  4. 4. Review</li></ul>Lab 3<br /><ul><li>Sync & Rollback
  5. 5. Review</li></ul>Lab 4<br /><ul><li>Conflict management
  6. 6. Review</li></ul>Lab 5<br /><ul><li>Locks & Revert
  7. 7. Review</li></ul>Lab 6<br /><ul><li>Branching
  8. 8. Review</li></ul>Lab 7<br /><ul><li>Merging
  9. 9. Review</li></ul>Alternatives to SVN<br />Other TortoiseSVN Tools<br />IDE Integration<br />Proven Practises<br />
  10. 10. Disclaimer<br />The names and scenarios presented here are purely fictional. Any similarity to real people or scenarios is purely a coincidence.<br />No animals were harmed during the making of this bootcamp.<br />
  11. 11. Time to get a little crazy<br />You need to be three people today<br />Jim, the junior software dev.<br />Just out of his local computer school and hired by BB&D. Wrote code at school and home – by himself.<br />Simon, the “seasoned” software dev.<br />Ran his own software company for a few years - that created iPhone apps. Company size of 1.<br />Joined BB&D when Palm Pre killed the iPhone market.<br />Mike, the grizzly IT Pro. Wears shirts that say things like “There are 10 types of people, those who know binary and those who don’t.” <br />
  12. 12. Supporting cast<br />The wizard – fly’s in and does magic!<br />(used for stuff you need, but don’t care about)<br />The customer, is all about giving:<br />Gives you requirements.<br />Gives you headaches.<br />Gives you money.<br />
  13. 13. Create a file share and do some changes.<br />Time: 5min<br />
  14. 14. Now...<br />The customer needs a bug fixed in version 1<br />
  15. 15. What’s in a Name?<br />
  16. 16. What is source control?<br />An agreed way to share development resources that gives us:<br />
  17. 17. Terminology<br />
  18. 18. Branching Terminology<br />
  19. 19. Basic Action Terminology<br />
  20. 20. Basic Action Terminology<br />
  21. 21. Mike: Create a repo<br />Simon: Check in a file<br />Jim: Get a file<br />Time: 5min<br />
  22. 22. Lab 2 - Review<br />Repo<br />DAL.txt<br />v1<br />Add<br />Get<br />DAL.txt<br />v1<br />
  23. 23. Lab 2 - Review<br />Is this how you should do your repo?<br /> No, use the TCP/IP or SVN protocol.<br />What is TortoiseSVN?<br /> The SVN client is a command line tool.<br />TortoiseSVN is a wrapper for that.<br />
  24. 24. Jim: Update the file & check it in.<br />Simon: Sync and rollback.<br />Time: 5min<br />
  25. 25. Lab 3 - Review<br />DAL.txt<br />v2<br />DAL.txt<br />v1<br />Update<br />Repo<br />Sync<br />Again<br />DAL.txt<br />v2<br />Issue Rollback<br />
  26. 26. Lab 3 - Review<br />Why did we have to commit again?<br /> Because there was a change<br />What revision are we now on?<br /> Revision 3<br />Can we get back to the code Jim put in, if we needed to?<br /> Yes<br />
  27. 27. Jim: Change the file<br />Simon: Change the file<br />CONFLICT!!<br />Time: 10min<br />
  28. 28. Lab 4 - Review<br />DAL.txt<br />v3<br />DAL.txt<br />v4b<br />DAL.txt<br />v5<br />Repo<br />Sync<br />Sync<br />Update<br />Update<br />Update<br />DAL.txt<br />v3<br />DAL.txt<br />v4<br />
  29. 29. Lab 4 - Review<br />Why did we have a .r3 and .r4 file?<br /> revision 3 & revision 4<br />What would happen if this was the changes and we tried to commit?<br /> It would auto merge<br />Jim<br />Simon<br />
  30. 30. Simon: wants to do a major code change and make sure Jim doesn’t mess with him<br />Time: 5min<br />
  31. 31. Lab 5 - Review<br />DAL.txt<br />v5<br />Sync<br />Repo<br />Lock<br />Sync<br />DAL.txt<br />
  32. 32. Lab 5 - Review<br />Who locked the file?<br /> Developer, the user logged into Windows<br />What happens if the person who locked the file goes on holiday?<br /> You can break the lock if needed.<br />
  33. 33. Simon: As they are releasing version 1 they want to make sure they can fix issues while working on v2.<br />Time: 10min<br />
  34. 34. Lab 6 - Review<br />Trunk<br />Repo<br />Trunk<br />V1 Branch<br />Branch<br />
  35. 35. Lab 6 - Review<br />Do we need to switch?<br /> No, but it helps keep focus and prevent issues across branches.<br />
  36. 36. Lab 6 - Review<br />What is shelving?<br />Shelving is branching to a personal temporary branch.<br />Why shelve?<br />Interruptions: Pending changes that are not ready for check in.<br />Integration/Handoff: Sharing code with someone else, without a check in.<br />Review: Code for review<br />Backup: Personal backup<br />
  37. 37. Lab 6 - Review<br />How to shelve?<br />Create a new root folder named shelve, as we did for branches.<br />In that a folder for each user.<br />Branching as normal.<br />
  38. 38. Lab 6 - Review<br />Which is correct?<br />V1.1 (start)<br />V1.2<br />V1.1 (start)<br />V1.1 FT3<br />DEV<br />DEV<br />3<br />4<br />5<br />8<br />RI<br />Branch<br />FI<br />V1,0 Hotfix 1<br />RI<br />RI<br />FI<br />FI<br />FI<br />Branch<br />V1.1<br />V1.2<br />V1.0<br />Production<br />V1.1<br />1<br />2<br />6<br />7<br />MAIN<br />Branch<br />FI<br />RI<br />V1.1 (bug fix)<br />V1.0<br />Production<br />RELEASE<br />Release 1.01<br />
  39. 39. Scenario #1: Single Team Branching Model<br />Nightly Build<br />(Early Validation)<br />All dev done on branch<br />CI / Nightly Builds<br />(Early validation)<br />V1.2<br />V1.1 (start)<br />V1.1 FT3<br />DEV<br />3<br />4<br />5<br />8<br />RI<br />RI<br />FI<br />FI<br />FI<br />Branch<br />V1.1<br />V1.2<br />1<br />2<br />6<br />7<br />MAIN<br />V1.1 (bug fix)<br />V1.0<br />Production<br />Main should be very stable<br />
  40. 40. Scenario #2: Concurrent Hot Fix, Service Pack, and v.Next<br />2<br />DEV …<br />The two DEV branches are created as sequential tasks, but as one unit of work.<br />All dev done on branches<br />2<br />DEV-1<br />Branch<br />MAIN<br />1<br />Branch<br />Branch<br />FI<br />R1 (SP)<br />R2 (SP)<br />6<br />SERVICE PACK<br />3<br />Branch<br />Branch<br />When MAIN is ready to release, create the SERVICE PACK, HOT FIX, and RELEASE branches at the same time.<br />Branch<br />R1 (SP0)<br />R1 (SP1)<br />R2 (SP0)<br />4<br />7<br />HOT FIX<br />Branch<br />Branch<br />Branch<br />R1 (SP0)<br />R1 (SP1)<br />R2 (SP0)<br />5<br />8<br />RTM<br />The RTM branch is a read-only copy of what was released<br />These should be read only<br />
  41. 41. Scenario #3: Branching and Labeling<br />The two DEV branches are created as sequential tasks, but as one unit of work.<br />TEST …<br />6<br />TEST-1<br />5<br />Branch<br />V1.2<br />Release labels in branch<br />DEV …<br />2<br />4<br />Branch<br />V1.1<br />DEV-1<br />2<br />3<br />Branch<br />1<br />MAIN<br />Main is just the latest<br />
  42. 42. Simon: Needs to make sure v2 gets the same bug fix as v1 had.<br />Time: 5min<br />
  43. 43. Lab 7 - Review<br />Branch v1<br />Conflict<br />Merge<br />Trunk<br />No cartoons, cause this is too hard to show with cartoons.<br />
  44. 44. Other TortoiseSVN tools <br />
  45. 45. WARNING<br />The tools to be presented next are based on some personal use and discussion.<br />They could break or not work – please consultant us and test prior to adoption.<br />
  46. 46. IDE Integration<br />http://ankhsvn.open.collab.net/<br />Free & Open Source<br />http://www.pushok.com/soft_svn.php<br />Costs ($27) & Proprietary<br />& about a billion other SVN clients ;)<br />
  47. 47. Alternatives to SVN<br />
  48. 48. Proven Practises<br />
  49. 49. Proven Practises<br />
  50. 50. Proven Practises<br />
  51. 51. Branching Proven Practises<br />

×