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.

Svn Basic Tutorial

38,818 views

Published on

I made a simple SVN (Subversion) tutorial for my co-workers and just wanted to share it with you. It is based on other lectures and practical experience I had in the past.
Some ideas also come from the GIT world, which is still too far and new for everyone, but which I already love and embrace fully :)

Published in: Technology
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • What if you had a printing press that could spit out hundred dollar bills on demand? Do you think that would change your life? ●●● http://t.cn/AisJWCv6
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • D0WNL0AD FULL ▶ ▶ ▶ ▶ http://1lite.top/unZhp ◀ ◀ ◀ ◀
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/qURD } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/qURD } ......................................................................................................................... Download doc Ebook here { https://soo.gd/qURD } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Svn Basic Tutorial

  1. 1. SVN BASIC TUTORIALFormatvorlage des Untertitelmasters Avoiding headaches ™ durch Klicken bearbeiten
  2. 2. Direct deployDeveloper 1 Staging LiveDeveloper 2 Staging LiveDesigner 1 Staging LiveDesigner 2 Staging Live
  3. 3. Removal of direct deployDeveloper 1 Staging LiveDeveloper 2 Staging Live Designer 1 Staging Live Designer 2 Staging Live
  4. 4. Why not to directly deploy• Can’t check the status of the environment• Race conditions (DEV1 and DEV2 work on a same file => collisions)• Can’t easily update the environment (full replace of the entire working copy needed)
  5. 5. SVN• Subversion (SVN) is a SCM (Software Configuration Management) implementation• It allows to track changes in files and directories• It allows concurrent development on the same files• It is centralized (one server)
  6. 6. SVN Interaction Designer 2 Designer 1 Staging Server Developer 2 Issue TrackerDeveloper 1 SVN Server Production Server
  7. 7. SVN development cycle Get last project status from SVN serverSend work to SVN server Develop/Design Test
  8. 8. SVN development (in SVN terms) svn update svn commit edit files Test
  9. 9. How it worksWill make some examples with TortoiseSVN and the command line to explain SVN
  10. 10. Fetching an existing project
  11. 11. Fetching an existing project
  12. 12. Fetching an existing project
  13. 13. Fetching an existing project
  14. 14. Fetching an existing projectThe «.svn» directory is used by subversion to keep track of changes in the currentdirectory tree.Do not change it, copy it somewhere else or delete it!
  15. 15. Fetching an existing project
  16. 16. Adding some files to the project
  17. 17. Adding some files to the project
  18. 18. Adding some files to the project
  19. 19. Adding some files to the project
  20. 20. Adding some files to the project
  21. 21. Updating working copy
  22. 22. Updating working copy
  23. 23. Updating working copy
  24. 24. Deploy with SVNWhen having SSH access to a server, deployingand updating becomes as easy as: $ ssh user@server.com $ cd path/to/project $ svn update(Or "svn co" if the project is not yet deployed)
  25. 25. Merging and conflictsIn the following schema, two developers try tocommit changes to a same file: echo ‘hello to’;Developer 1 echo $username; echo ‘hello world ’;Developer 2 echo $_GET[‘username’];RED = changed by developer
  26. 26. How merging worksWhen Developer 2 tries to commit, SVN will tell himthat his copy is outdated, he will have to update it
  27. 27. How merging works
  28. 28. How merging worksMerging won’t cause any changes on the server, you will firstget all the changes locally, so that you can review them. Here’sthe result of this merge case: We can then $ svn commit -m "Merged changes of marco’s commit"
  29. 29. Merging workflow svn commitDeveloper verifies merge Can’t commit (outdated working copy) svn tries to merge svn update
  30. 30. What if SVN can’t merge? svn commitSVN couldn’t merge Can’t commit (outdated working copy) ???????? svn tries to merge svn update
  31. 31. SVN ConflictsSVN conflicts happen when two developers act on asame file in the same line: echo ‘hello everybody’;Developer 1 echo $_GET[‘username’]; echo ‘goodbye everybody’;Developer 2 echo $_GET[‘username’];RED = changed by developer
  32. 32. SVN Conflicts
  33. 33. SVN Conflicts• index.php is a merged view of the conflict:•• index.php.r8 is the version before the update• index.php.r9 is the version as in SVN server• index.php.mine is the version you had in your directory before committing
  34. 34. SVN ConflictsWe can edit the files until all conflicts are solved,then tell SVN it should accept our new workingcopy:
  35. 35. SVN Conflicts svn commit Mark conflicts as resolved Can’t commit (outdated working copy)Manually edit conflicts svn update SVN couldn’t merge svn tries to merge
  36. 36. Parallel development
  37. 37. SVN branchingMain project Next major version updateThe main project and it’s features Bugfix for a known bug Keeps track of changes to be merged into the next major release of the software New feature that has to be added Work in progress to fix a known bug Alternate version to show to the customer A new feature that requires some work without being influenced b A slightly different version of the site that t
  38. 38. This is actually howgit-flow by nvie.comhandles development,but SVN could also useit!
  39. 39. What is a branch?In SVN terms, a branch is just a copy of a current tree. Let’s create a branch to develop an alternate layout for the site: svn copy -m “creating green site dev branch” svn://path/to/repo/trunk svn://path/to/repo/branches/wide-layout (in TortoiseSVN it is under “branch/tag” in context menu)
  40. 40. Switching working copyGiven that you checked out: svn://project/path/trunkYou can now switch to a branch by doing svn switch svn://project/path/branches/redand you will be working on that copy
  41. 41. Merging branchesOnce completed developing on a branch, you may want to merge changes back:
  42. 42. Merging branchesLike normal conflict merging!
  43. 43. First you switch to the branch you want changes to be merged to: $ svn switch svn://path/to/target/branch
  44. 44. Then you merge a set of revision from the branch you developed on (here 25 to latest):$ svn merge -r25:HEAD svn://path/to/merged/branch
  45. 45. Then SVN will merge any conflicts or set conflicted state and allow you to check what happened. After fixing conflicts:$ svn ci -m “merging changes from new-layout branch”
  46. 46. TagsTags are markers used for deployment, mainly for major release versions:
  47. 47. TagsTags are copies, exactly like branches: $ svn copy -m “tagging version 1.1 of the project” svn://path/to/project svn://path/to/tags/1.1Except that you NEVER commit on tags!
  48. 48. svn:externalsExternals are “links” to other repositories: $ svn propset svn:externals “css/common svn://company/common/css/files” ./ Externals are not part of the repository, they are just fetched with the repository (useful for deploying applications!)
  49. 49. Best practices
  50. 50. Update your projects before working
  51. 51. Do not commit broken code/functionality! (Test before committing if possible!)
  52. 52. Commit as soon as a piece of the functionality is completed
  53. 53. Branch life should not be too long Long living branches increase merge conflicts!This forces you to keep small units of work
  54. 54. Every commit should have a purpose. Commits with no purpose to be avoided! If possible, avoid multiple commits onseparate files being part of one functionality
  55. 55. Never commit generated code/data!Generated code can produce dozens of useless commits, conflicts and generally, headaches!
  56. 56. EVERY COMMIT MUST HAVEDESCRIPTION
  57. 57. Examples of BAD commit messages:- “Fixed bug”- “Updated”- “Saved work”- “Updating”- “Merging changes”- “Saving work of 10/3/2010”
  58. 58. Examples of GOOD commit messages:- “Adding CSS definitions needed to create a lightbox overlay when focus is on the offers iframe”- “Fixed bug with session expiring after browser restart on IE7”- “Updated the logo with the new colors provided”- “Adding interfaces for the new blog feature The interfaces are still quite lightweight, but should be refreshed in the next days”-
  59. 59. If using an issue tracker (Jira, Trac,Bugzilla, Redmine, etc.), write the issue ID in the commit message: «Fixed iframe width causing scrollbars to appear when not needed as of PRJ-123»
  60. 60. Optimal process
  61. 61. Update working copy Build (test first)If there’s errors, fix them first! (do not work on broken projects) Develop Test changes Commit (with appropriate message) Resolve conflicts immediately
  62. 62. Suggested Workflow
  63. 63. This is actually howgit-flow by nvie.comhandles development,but SVN could also useit!

×