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.

Subversion workshop


Published on

A dutch presentation about the basics of subversion on the commandline.

Published in: Technology
  • Be the first to comment

Subversion workshop

  1. 1. SVN workshop By Tim de Pater / @trafex
  2. 2. Index <ul><ul><li>Basics </li></ul></ul><ul><ul><li>Conflicts </li></ul></ul><ul><ul><li>Branching </li></ul></ul><ul><ul><li>Merging </li></ul></ul><ul><ul><li>Release management  </li></ul></ul><ul><ul><li>Best practice </li></ul></ul>
  3. 3. Basics <ul><li>svn checkout </li></ul>$ svn checkout projectfolder   A    projectfolder/files Checked out revision 14.
  4. 4. Basics <ul><li>svn info </li></ul>Path: . URL: Repository Root: Repository UUID: 317ccd4c-6b34-0410-924f-f0004c2b7d44 Revision: 12664 Node Kind: directory Schedule: normal Last Changed Author: tpater Last Changed Rev: 12664 Last Changed Date: 2011-03-11 11:25:13 +0100 (Fri, 11 Mar 2011)
  5. 5. Basics <ul><li>svn status </li></ul>      'A' Added       'C' Conflicted       'D' Deleted       'I' Ignored       'M' Modified       'R' Replaced       'X' an unversioned directory created by an externals definition       '?' item is not under version control       '!' item is missing (removed by non-svn command) or incomplete       '~' versioned item obstructed by some item of a different kind
  6. 6. Basics <ul><li>svn update </li></ul>$ svn up U    grocerylist.txt Updated to revision 14.
  7. 7. Basics <ul><li>svn add </li></ul>$ svn add index.php A         index.php
  8. 8. Basics <ul><li>svn commit </li></ul>$ svn commit -m 'Commit melding' Sending        src/templates/admin/newspapermanagement.php Transmitting file data . Committed revision 12854.
  9. 9. Basics <ul><li>svn revert </li></ul>$ svn revert public/index.php Reverted 'public/index.php'
  10. 10. Basics <ul><li>svn mv </li></ul><ul><li>svn rm </li></ul><ul><li>svn cp </li></ul><ul><li>svn mkdir </li></ul><ul><li>svn ls </li></ul>svn help <command>
  11. 11. Conflicts <ul><li>  </li></ul>$ svn up Conflict discovered in 'grocery.txt'. Select: (p) postpone, (df) diff-full, (e) edit, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: 
  12. 12. Conflicts <ul><li>Ontstaan doordat 2 mensen dezelfde regel bewerken </li></ul>
  13. 13. Conflicts <ul><li>grocery.txt </li></ul>Milk <<<<<<< .mine Hot Dog ======= Cheese >>>>>>> .r12 Juice Milk Hot Dog Juice svn up
  14. 14. Resolving conflicts - option 1 <ul><li>Versie van collega accepteren </li></ul>$ svn revert grocery.txt Reverted 'grocery.txt'
  15. 15. Resolving conflicts - option 2 <ul><li>Eigen versie behouden </li></ul><ul><ul><li>grocery.txt – orgineel met markeringen </li></ul></ul><ul><ul><li>grocery.txt.mine – eigen versie </li></ul></ul><ul><ul><li>grocery.txt.r5 – orgineel die je bewerkt hebt </li></ul></ul><ul><ul><li>grocery.txt.r6 – nieuwste versie die je collega bewerkt heeft </li></ul></ul>$ cp grocery.txt .mine grocery.txt $ svn resolved grocery.txt Resolved conflicted state of 'grocery.txt'edition
  16. 16. Resolving conflicts - option 3 <ul><li>Handmatig mergen </li></ul><ul><li>Conflict oplossen optie 2 </li></ul>Milk <<<<<<< .mine Hot Dog ======= Cheese >>>>>>> .r12 Juice Milk Hot Dog Cheese Juice $ svn resolved grocery.txt
  17. 17. Conflict your neighbour <ul><ul><li>Checkout </li></ul></ul><ul><ul><li>Zorg dat je een conflict krijgt met je buurman </li></ul></ul><ul><ul><li>Los het conflict handmatig op </li></ul></ul>
  18. 18. Branching
  19. 19. Branching <ul><li>svn cp </li></ul>$ svn cp -m 'Created branch to implement guestbook feature'   Committed revision 13.
  20. 20. Branching <ul><li>svn switch </li></ul>$ svn sw   At revision 13.
  21. 21. Branch pattern
  22. 22. Merging <ul><li>We willen feat-digitaledition mergen met release-2.1 branch. </li></ul><ul><ul><li>Vind het revisie nummer waarin de feature branch is aangemaakt </li></ul></ul><ul><ul><li>Vind het revisie nummer van de laatste wijziging in de feature branch </li></ul></ul><ul><ul><li>Voer de merge uit </li></ul></ul><ul><ul><li>Commit </li></ul></ul>
  23. 23. Merging Vind het revisie nummer waarin de rfc branch is aangemaakt $ svn log --stop-on-copy <...scroll down...> ------------------------------------------------------- r13 | tpater | 2011-03-28 12:20:38 +0200 (Mon, 28 Mar 2011) | 1 line Created branch to implement digitaledition ------------------------------------------------------- $
  24. 24. Merging Vind het revisie nummer van de laatste wijziging in de rfc branch $ svn log -l 1 ----------------------------------------------------- r15 | tpater | 2011-03-28 16:55:53 +0200 (Mon, 28 Mar 2011) | 2 lines Implemented crap
  25. 25. Merging svn merge $ svn merge -r 13 : 15 --- Merging r14 through r15 into '.': A    test.txt $ svn ci -m 'Merged with feat-digitaledition' Sending        . Adding         test.txt Committed revision 16.
  26. 26. Merging your ass off <ul><ul><li>Merge </li></ul></ul><ul><ul><ul><li>NederlandsDagbladXX/branches/release-2.1 </li></ul></ul></ul><ul><ul><ul><li>NederlandsDagbladXX/branches/feat-digitaledition </li></ul></ul></ul><ul><ul><li>Repo: </li></ul></ul>
  27. 27. Release management <ul><ul><li>Mantis </li></ul></ul><ul><ul><li>Deploy  </li></ul></ul><ul><ul><li>Versie's </li></ul></ul><ul><ul><li>Changelogs </li></ul></ul>
  28. 28. Best practice <ul><ul><li>Committen doe je per rfc/bugfix/wijziging </li></ul></ul><ul><ul><li>Zorg dat het aantal wijzigingen per commit klein blijven </li></ul></ul><ul><ul><li>Commit alleen werkende code </li></ul></ul><ul><ul><li>Geef in je commentaar aan WAAROM je een bepaalde wijziging hebt doorgevoerd. </li></ul></ul><ul><ul><li>Geef in het commentaar niet aan om welke bestanden het gaat, deze gegevens zijn beschikbaar. </li></ul></ul>
  29. 29. URL's <ul><ul><li> </li></ul></ul><ul><ul><li> </li></ul></ul><ul><ul><li> </li></ul></ul>
  30. 30. Vragen?