Quickstart Guide to Subversion on SourceForge

code, open source 0 comments suggest edit

Good news! SourceForge now supports using Subversion for source control!

One complaint I received from developers who read my Quickstart Guide To Open Source Development With CVS and SourceForge is the sheer amount of complexity just to get started (not that it was my fault, I was just the messenger). With Subversion, contributing to a project on SourceForge is now much simpler.

Benefits of Subversion over CVS

Subversion has several key benefits over CVS, a few of which are listed here…

  • Subversion supports WEBDAV+DeltaV which works over HTTPS so that whole process of generating an SSH key is no longer necessary.
  • Checkins are atomic (“all or nothing”). This helps keep a check-in error from causing a broken build.
  • Subversion versions file and directory renames and moves.
  • Branching and tagging are fast as they are implemented as a copy operation within the repository.

Drawbacks to Subversion

The one key drawback to Subversion has to do with the last benefit listed. This was an architectural decision by the Subversion team to simplify and speed up branching and tagging. For branching, this is not such a bad idea. A branch is simply another folder within the repository. By convention, this tends to be a folder within a top-level “branches” folder.

For tags though, this is not as ideal because Subversion does not restrict editing tags. In fact, tagging as it is done in CVS does not exist in Subversion. Tagging is merely a convention developers follow by branching (a repository copy operation) to a subfolder of the top-level “tags” folder. To enforce a tag, one would have to implement a hook script to disable edits.

Software

Before we continue with this guide, please download the following tools.

  • TortoiseSVN
    • a Windows SVN client
  • Official SVN Client (OPTIONAL: for those who prefer a command line client, though this guide will focus on using TortoiseSVN).

Checking Out a Repository

At this point, you are all set to get going. One key difference between CVS and Subversion is that Subversion does not have the concept of a “module” like CVS. In Subversion, all your code is organized into folders within a repository.

  1. Make sure you’ve been added as a developer to the project you’re going to work on. A project administrator would have to do this.
  2. In Windows Explorer go to the folder you wish to check the code out into.
  3. Right click and select the SVN Checkout command: Subversion Checkout context
menu
  4. This will bring up the following checkout dialog. You will need to know the url of the project’s repository. This should simply be https://{project unix name}.svn.sourceforge.net/svnroot/{project unix name}. The URL to the project’s trunk is typically located at https://{project unix name}.svn.sourceforge.net/svnroot/{project unix name}/trunk. Note that the url is “https” and not “http”.

    For example, the URL to the Subtext repository is https://subtext.svn.sourceforge.net/svnroot/subtext. However, it is not a good idea to check out the top level repository folder (believe me). That will download every file in every tag and branch. Instead, you should enter the URL to the trunk. For Subtext, you would enter https://subtext.svn.sourceforge.net/svnroot/subtext/trunk

    TortoiseSVN Checkout
Dialog

  5. TortoiseSVN will prompt you for your SourceForge username and password. You can optionally check a box to have it save your credentials so that you do not need to enter them every time.
  6. At this point, I received an invalid certificate dialog. Hopefully this will be fixed soon as it is not generally a good habit to accept an invalid certificate. Invalid Certificate
Dialog
  7. Wait patiently as files are retrieved from the repository and copied to your local machine.

Now Write Some Code

Note that you only have to checkout the repository once. Afterwards you can run the update command to get changes committed by other developers. It’s a good idea to do this before and after you make any changes.

TortoiseSVN Update Context
Menu

Commiting Changes {.clear}

After you’ve changed some files, their icons be marked with an orange arrow. To commit your changes, right click and select the Commit command. Please make sure to enter an informative comment.

TortoiseSVN Commit Context
Menu

To commit multiple changes, right click on the root folder and select Commit. You’llget a list of all changed files. You can check the ones you wish to commit and commit them in bulk.

Adding Files

If you add a new file to the project, you’ll need to add it to Subversion and then commit it. To add a file, simply right click on it and select “TortoiseSVN | Add”.

TortoiseSVN Add File Context
Menu

Know when to ignore {.clear}

TortoiseSVN is not integrated with Visual Studio.NET. Thus it doesn’t know that there are some files you do not want to add to Subversion such as *.suo, *.pdb and maybe the bin and obj folders. There are a couple ways to tell Subversion to ignore certain files.

The way Subversion handles ignored files is different from CVS. In CVS ignore settings are repository wide. For Subversion, the ignore list is a folder by folder setting. Thus ignoring a file within a folder does not necessarily apply that setting to its subfolders.

The quick way to add a specific file or file extension to the ignore list for a folder is to right click on the file and select TortoiseSVN | Add To Ignore List.

TortoiseSVN Add To Ignore List Context
Menu

Since this ignore list only applies to the specific folder (and not to subdirectories), another approach is to setting an ignore list for the project is to right click the root folder and select the normal Windows Properties dialog. You will notice a Subversion tab in the dialog.

Subversion Property
Dialog

This dialog allows you to specify various Subversion properties (meta-data) including one called svn:ignore. Select the svn:ignore property (or if it is not in the drop down, just type it in there). Underneath the drop down, you can type in wildcards for the file extensions to ignore. If you wish to set each sub-folder with the same svn:ignore values, then check the recursive checkbox before clicking Apply or OK.

Submitting Patches as a Non-Developer {.clear}

If you do not have developer access, you can still submit patches to a project. In most SourceForge project sites, there is a “Patch” section where patches can be submitted. In order to learn how to submit and apply patches, read the following article Using a Windows version of GNU Patch.exe with CVS and Diff Files.

For More Information

Conclusion

Again, I hope this gets you on your feet when joining an open source project on SourceForge. By supporting Subversion, SourceForge has removed some of the complexity in getting involved. Subtext will be migrating to Subversion at some point in time. When we do so, I will be sure to update this document with any lessons learned.

Found a typo or error? Suggest an edit! If accepted, your contribution is listed automatically here.

Comments

avatar

89 responses

  1. Avatar for Ricky Dhatt
    Ricky Dhatt February 22nd, 2006

    ITYM "Drawbacks to Subversion", not "Drawbacks to CVS".



    Also, you could enforce a tag/branch by setting a folder to read-only in Subversion (don't know if SourceForge prevents this or not)

  2. Avatar for Simone Chiaretta
    Simone Chiaretta February 22nd, 2006

    When will Subtext move to SVN? :)

  3. Avatar for Steve Harman
    Steve Harman February 22nd, 2006

    Simo...

    I'm not sure if you saw the comment I made here [http://haacked.com/archive/2006/02/17/WhatEveryDeveloperShouldKnowAboutSourceControl.aspx#11847], but I was really tempted to "push the button" the other day. But then logic set in and I knew it was not the time... but I'll be pushing for a move to SVN soon after the 1.0 release... so soon!



    Great article Phil! I too hope that this will help ease people into getting involved with/contributing to Open Source projects.



    Now, I can't wait 'till _someone out there_ writes an app to tightly integrate SVN into Visual Studio. Though, on second thought... I've really gotten used to the TortoiseCVS/TortoiseSVN way of doing things through the windows explorer. But, then on a 3rd hand... I do love how Eclipse/Rational Application Developer [RAD] integrate so well with ClearCase in my work environment.

  4. Avatar for Haacked
    Haacked February 22nd, 2006

    Ricky: thanks! I fixed the typo.



    Steve: There is an add-in for VS.NET called Ankh. I've never tried it.



    Simone: I'll take a poll soon.

  5. Avatar for Steve Harman
    Steve Harman February 22nd, 2006

    I guess I kind of said the above a bit tounge-in-cheek...



    However, I shouldn't sell anyone short as I've not tried Ankh in a long time (over year at least). I pseudo-evaluated it for version control of my own side projects and I ran into all kinds of issues. Though, in hind site I'm sure many of those were due to user (my) error. I say pseudo-evaluated b/c shortly there-after I started working with subText, and at that time my "side project" (my own dotText install) when by the wayside.



    At any rate, once we move subText to SVN I'll be sure to give Ankh another shot, and no doubt be surprised at how well it works.

  6. Avatar for ragundo
    ragundo February 22nd, 2006

    Sorry for the offtopic, but, the windows theme of the screenshots is fantastic. Is it possible to get it ?



    Greetings from Spain

  7. Avatar for Steve Donie
    Steve Donie February 28th, 2006

    Nice article. I linked to it from my blog, where I posted an article yesterday on setting up a subversion server on Windows.

  8. Avatar for Joshua Flanagan
    Joshua Flanagan June 26th, 2006

    TortoiseSVN has menu commands for creating and applying patches. No need to mess with GNU patch and diff.

  9. Avatar for Student Organization Guy
    Student Organization Guy August 28th, 2006

    I am finally moving away from my ancient RCS environment. Thanks for the clear step by step tutorial.

  10. Avatar for how to apply a GNU patch on Wi
    how to apply a GNU patch on Wi October 14th, 2006

    Using a Windows version of GNU Patch.exe with CVS and Diff Files“. should now probably refer to:
    http://www.hanselman.com/bl...

  11. Avatar for Andy James
    Andy James January 31st, 2007

    Good thing that you cleared the right patch after all :)

  12. Avatar for Peter Mansion
    Peter Mansion February 23rd, 2007

    If you're having trouble writing to sourceforge then check that you have SVN enabled (in sourceforge) for each developer.
    Pete

  13. Avatar for Monty
    Monty June 6th, 2007

    Wow, my comment icon looks like the London Olympic Logo!

  14. Avatar for Welcome to Simon Philp's Blog
    Welcome to Simon Philp's Blog December 8th, 2007

    Small Site Update

  15. Avatar for Jonathan
    Jonathan December 22nd, 2007

    excellent step-by-step tutorial i only can recommend this and a nice explaining of the "all-in-one-package" thank you, its great!

  16. Avatar for rdeman
    rdeman March 27th, 2008

    when I signed up my SF.net project the welcome email only told me about CVS - not SVN.
    It seems that https://{project unix name}.svn.sourceforge.net/svnroot/{project unix name}/ for my project doesnt exist -- any idea why?

  17. Avatar for David Piepgrass
    David Piepgrass May 18th, 2008

    1. Make sure you’ve been added as a developer to the project you're going to work on. A project administrator would have to do this.
    What's step zero: i.e. I am the administrator and I'd like to start using SVN on SF for the first time?

  18. Avatar for Michael Web
    Michael Web July 26th, 2008

    Good thing that you cleared the right patch after all :) yes i also think it's quite genious.

  19. Avatar for Metagro
    Metagro August 25th, 2008

    Nice article. I linked to it from my blog, where I posted an article yesterday on setting up a subversion server on Windows.

  20. Avatar for Seo Beratung
    Seo Beratung October 25th, 2008

    Thanks for your great step-by-step guide...

  21. Avatar for TechnoS
    TechnoS November 1st, 2008

    I have been using http://ankhsvn.open.collab.net/ for quite a while now and it works pretty good. The svn server is local so everything is really fast.

  22. Avatar for TechnoS
    TechnoS November 1st, 2008

    See below on how to enable SVN in SourceForge.
    8thstring.blogspot.com/.../...-to-sourceforge.html

  23. Avatar for Matratze
    Matratze November 20th, 2008

    Your guide is really great and easy to understand. Thanks for publishing it... ;-)

  24. Avatar for Vibrationsplatte
    Vibrationsplatte December 1st, 2008

    @ TechnoS: thanks a lot for your advice!

  25. Avatar for Fettabsaugung
    Fettabsaugung December 11th, 2008

    Really a nice and very informative article. I bookmarked it for sharing it with my friends.
    Thanks for publishing these good infos... ;-)

  26. Avatar for Mobile SEO
    Mobile SEO December 11th, 2008

    Phil, your article contains exactly the information I needed. Very good work. No I don't need to search anymore for these informations.

  27. Avatar for Partnersuche
    Partnersuche December 13th, 2008

    Your article helps us a lot, Phil. I've desperately looking for these infos by myself but I didn't find out, how to... Thanks for writing this interesting article, sharing this tips and saving my time!!!

  28. Avatar for Babyaufkleber
    Babyaufkleber January 8th, 2009

    Yes its a great and informative article.
    Thanks for the infos!

  29. Avatar for Russland Visum
    Russland Visum January 9th, 2009

    SourceForge is for me a problem because of dato misuse.

  30. Avatar for Ledersofa
    Ledersofa January 11th, 2009

    Hello Russalnd Visum: source forge is becoming better and sure.

  31. Avatar for Agentur
    Agentur February 21st, 2009

    Nice article, Phil. If you don't mind I would like to link to it from my own website.
    Best wishes from Germany!

  32. Avatar for Messie Beratung
    Messie Beratung March 29th, 2009

    This site is very well designed. Nice use of colors and typography!

  33. Avatar for ahmet maranki
    ahmet maranki December 15th, 2009

    thanks a lot for your advice...

  34. Avatar for Volker
    Volker December 16th, 2009

    Ein Kompliment für diese tolle Seite.
    Eigentlich bin ich durch Zufall darauf gestoßen und dachte mir,
    einen netten Eintrag und viele Grüße zu hinterlassen.
    _____ \\\!!!///____
    ______( ô ô )_____
    ___ooO-(_)-Ooo___
    Vielleicht schauen sie mal auf meiner Homepage vorbei!

  35. Avatar for takien
    takien December 28th, 2009

    When I want to commit a file that already edited. there is an error says:
    Commit failed (details follow): File '/svnroot/..../file.php' already exists
    what to do?

  36. Avatar for Mustafa Ulusoy
    Mustafa Ulusoy December 28th, 2009

    Hey thanks good article

  37. Avatar for kişiye özel hediyeler
    kişiye özel hediyeler December 28th, 2009

    Thanks very good article and a nice blog

  38. Avatar for Ferienwohnung Ostsee
    Ferienwohnung Ostsee January 1st, 2010

    goog article, easy to understand, congratulations.
    Happy New Year to all from the Baltic Sea
    Gaby

  39. Avatar for Britta
    Britta January 2nd, 2010

    Viele Grüße von der Ostsee

  40. Avatar for Ferienwohnung Ostsee Meerblick
    Ferienwohnung Ostsee Meerblick January 5th, 2010

    well structured guide, thanks.
    Happy New Year from the Baltic Sea
    Michael

  41. Avatar for Mustafa Ulusoy
    Mustafa Ulusoy January 10th, 2010

    thanks good post my friend :)

  42. Avatar for Flo
    Flo January 10th, 2010

    Good article! Thank you! I hope to read more in 2010! :-)

  43. Avatar for Michael
    Michael January 23rd, 2010

    Very useful information about sourceForge, thanks a lot!

  44. Avatar for kevin
    kevin January 29th, 2010

    Nice guide. Now if I could only get tortoise to work on vista. i hate vista.

  45. Avatar for inearkopfhoerer
    inearkopfhoerer February 3rd, 2010

    Great guide. It really helped me. Thank you for puting so much time and effort in this blog.
    Regards
    inearkopfhoerer

  46. Avatar for Christlove
    Christlove February 4th, 2010

    Thanks for your great step-by-step guide, Very good overview.

  47. Avatar for Online Sweepstakes
    Online Sweepstakes February 9th, 2010

    I am not much into reading, but somehow I got to read nice information on your site. Simple to understand and helpful. We will look forward for your future updates.
    Thanks

  48. Avatar for Tim
    Tim February 9th, 2010

    A lot of useful information on your site. Thank you
    Greetings from Hamburg

  49. Avatar for Küchen Freiburg
    Küchen Freiburg February 10th, 2010

    Viele Grüße aus Freiburg

  50. Avatar for Jürgen Schuberth
    Jürgen Schuberth February 22nd, 2010

    Great Site - Thanks for a lot of information. I put your site in my Favorites

  51. Avatar for Matteo Alt
    Matteo Alt February 22nd, 2010

    Perfekt. Nach so einer Seite habe ich sehr lange gesucht. Viel Erfolg noch damit.

  52. Avatar for Kabarettist
    Kabarettist February 23rd, 2010

    Good article! Thank you!

  53. Avatar for Ferienwohnung Ostsee
    Ferienwohnung Ostsee February 26th, 2010

    Thanks and Greeting from the Baltic Sea
    Gaby

  54. Avatar for Prepaid Anbieter
    Prepaid Anbieter March 8th, 2010

    Sehr gut, danke für diesen tollen Tipp :-)

  55. Avatar for Hotels in Bodenmais
    Hotels in Bodenmais March 8th, 2010

    Thanks and Greeting from Bodenmais in the Bayerischer Wald.

  56. Avatar for Suchmaschinenoptimierung
    Suchmaschinenoptimierung March 11th, 2010

    Great Site - Thanks and Greeting

  57. Avatar for Günter Hogrefe
    Günter Hogrefe March 14th, 2010

    Vielen Dank für diesen Schnellstart...:-). Jetzt läuft doch alles wie geschmiert, warum nicht gleich so...:-)
    Gruß
    Günter

  58. Avatar for Immobilien kaufen
    Immobilien kaufen March 15th, 2010

    Hello,
    Good article! Thank you so much!

  59. Avatar for ADS
    ADS March 19th, 2010

    Great Site - Thanks for a lot of information !

  60. Avatar for Dürrschnabel
    Dürrschnabel March 23rd, 2010

    Great Site. TX for this informations

  61. Avatar for Notar Rostock
    Notar Rostock March 23rd, 2010

    Nice article - thx a lot!

  62. Avatar for Kalp Hastanesi
    Kalp Hastanesi March 24th, 2010

    Thanks good article about Quickstart Guide I laughed a lot after seeing some of these card. Who in the world would use a business card in the form of a razor blade and which is also sharp?????

  63. Avatar for Massagesessel Shop
    Massagesessel Shop March 31st, 2010

    Great and easy to unterstand article. I should have read this earlier.

  64. Avatar for garaj kapısı
    garaj kapısı April 4th, 2010

    thank you very much great article, well done.

  65. Avatar for Paintball
    Paintball April 15th, 2010

    Really well article, you write really good and this article helps me and saves me daily hours - thank you for sharing

    Regards from Germany

  66. Avatar for Sac Ektirme
    Sac Ektirme April 20th, 2010

    inforamtiv article you have write it very good gratulations

  67. Avatar for Gemälde
    Gemälde April 21st, 2010

    thanks good post and informativ Article.

  68. Avatar for Kinderbücher
    Kinderbücher May 2nd, 2010

    Thanks for that really, really great article, it helped me much for my kinderbücher.

  69. Avatar for Online Marketing Agentur
    Online Marketing Agentur May 3rd, 2010

    hi phil, very thanks for the helpful article. regards from your online marketing & web development team. tom

  70. Avatar for Hoteleinrichter
    Hoteleinrichter May 4th, 2010

    nice Article, very thanks !

  71. Avatar for Heiko
    Heiko May 13th, 2010

    Very interesting tutorial I can only recommend it for this all in one package. Toll keep it up

  72. Avatar for Censis
    Censis May 15th, 2010

    Very interesting guide. It is really helpful. Thanks!

  73. Avatar for Alquiler de yates en Ibiza
    Alquiler de yates en Ibiza May 17th, 2010

    thanks for sharing. greeting..

  74. Avatar for Lüks arac kiralama
    Lüks arac kiralama May 23rd, 2010

    good article nice post from oyu

  75. Avatar for Sabrina
    Sabrina June 6th, 2010

    Thanks for your great step-by-step guide for subversion, this helped me a lot.

  76. Avatar for Küchen Freiburg
    Küchen Freiburg June 7th, 2010

    Thanks for the tutorial, it's pretty helpful.

  77. Avatar for Andy Holland
    Andy Holland June 22nd, 2010

    This site is bookmarked. Very helpful. Thanks

  78. Avatar for Cem
    Cem June 24th, 2010

    I will give you a link from my site too your article is very helpfull for me

  79. Avatar for urkunden vorlagen
    urkunden vorlagen June 27th, 2010

    I have some problems with this Part " This will bring up the following checkout dialog. You will need to know the url of the project’s repository." please can you send me a quick email. Thanks in Advanced

  80. Avatar for lobur
    lobur July 11th, 2010

    thanks.good for this..Very helpful. Thanks

  81. Avatar for Tinchen
    Tinchen July 13th, 2010

    thanks for the detailed explanation and description

  82. Avatar for Camp
    Camp July 24th, 2010

    Great guide! Thank you for sharing.

  83. Avatar for çiçek
    çiçek August 5th, 2010

    Very interesting guide. It is really helpful.
    Thanks! Admin

  84. Avatar for Sebcom online
    Sebcom online August 10th, 2010

    Good article! Thank you! Realy helpful.

  85. Avatar for Wandtattoos and Wallsticker
    Wandtattoos and Wallsticker August 11th, 2010

    Very nice post, my best regards MIkel

  86. Avatar for AdWords Optimierung
    AdWords Optimierung August 21st, 2010

    hanks for the detailed

  87. Avatar for Fabian
    Fabian August 22nd, 2010

    Very helpful information, thank you a lot!

  88. Avatar for Bryan C
    Bryan C September 22nd, 2010

    Thanks so much for this abbreviated, clear and very cool tutorial. I always wanted to learn SVN, and this was an awesome jump start.
    It's funny - I just started Fall quarter at the university, and this was one of the Lecture 1 topics/exercises. I feel good now. Thanks so much.

  89. Avatar for Edwin Yip
    Edwin Yip March 19th, 2013

    Thanks. When compared to Google Code which provides "svn checkout" commands for each project, SF's not really user friendly...