Sponsored By Aspose - File Format APIs for .NET

Aspose are the market leader of .NET APIs for file business formats – natively work with DOCX, XLSX, PPT, PDF, MSG, MPP, images formats and many more!

Getting started with subversion

Good tools are half the job. Being a one person shop I believed VSS was good enough for my source control needs. Almost everybody says Subversion is a far better alternative. The main advantage mentioned is (beside stability and all that) the different and better way subversion handles multiple users working on the same file. As a one person shop that’s not that important. The main downside mentioned is a somewhat steep learning curve. But recently, after another frustrating struggle with VSS, I had enough and spent my energy on an exploration of Subversion.

It was a delight. The learning curve is by far not as steep as I feared. Besides that the documentation included is quite good. My only problem was to find a good starting point. I found this in TortoiseSVN, which presents itself as just a client but does contain everything I need. The help files tell all you want to know about Subversion and more. Here I’ll just summarize the things you need for a jumpstart.

TortoiseSVN presents itself as a shell extension. So it is available in all explorer windows. Subversions stores the sources (or any other file) of a project in a repository. A repository is a folder in the file system. The procedure to create a repository and a working copy is different than VSS, there is no such thing as "Add to source control". You have to create and fill the repository first and create a new working copy after that. These are the steps:

  • Install TortoiseSVN
  • Create a folder to store your repositories. After setting up a repository you will not work with this folder yourself. All interaction runs through the TortoiseSVN shell extensions
  • Setup a template folder. This folder describes the structure of new repositories. Recommended is the trunk/branches/tag tree you meet everywhere in subversion docs.
  • Create new empty folder for the project.
  • Right click it and pick create repository here in the TortoiseSVN context menu. This will fail when the folder is not empty.
  • Select the template folder and pick Import in the TortoiseSVN context menu. You will be asked for a repository. Select the repository folder for the project you just created.
  • Select the folder of the project you want to add to the repository. Again pick Import from the context menu. Select the repository and pick the trunk folder.
  • Create a new empty working folder for the project.
  • In the context menu pick SVN checkout and select the repository. TortoiseSVN will warn when the folder is not empty.

And now source control is fully integrated in the windows explorer, including all dialogs. An update from or a commit to the repository are just a context click away. TortoiseSVN presents the status of the folder in icon overlays.

You don’t want all files to be under control. Because they muddle up your repository, but also because they spoil the visible status. Just building the project would turn the icon of the root folder red. TortoiseSVN has loads off ways to describe excluded files. I’m still wrestling somewhat with the list. So far I’ve come up with

*.dll* *.pdb *.CACHE  _ReSharper.* *resharper* Iesi.Collections.xml Castle.DynamicProxy.xml log4net.xml NHibernate.xml

But there will be a better way without any doubt. There is also a Visual Studio add-in for SVN, the only Subversion commercial product I know of. (Yes, also subversion is an open source project) But I haven’t looked at that yet.

I have only talked about this client tool. For the moment this does fulfill all my needs. I can reach repositories over the network using a file url like  file://HARAHARA/Users/Peter/SubversionRepositories/Gekko\Website/trunk (mind the (back-)slashes). In case I need more, there is whole load of subversion servers available for any platform.

That’s about it. Another great tool added to my box.

This entry was posted in Uncategorized. Bookmark the permalink. Follow any comments here with the RSS feed for this post.
  • http://tombrander.wordpress.com Tom Brander

    I think you may be missing out if you don’t get on Mercurial.

    Like you I am a sole dev but working more in the open source community and the only real question is whether it is moving to Git or Mercurial.

    Mercurial is much more accessible to mere mortals, will soon be supported in Google code has a TortiseHG extension much like SVN,, it is the wave of the future…with
    http://www.selenic.com/mercurial/wiki/

  • Oswaldo Bernardes

    I’ve tried to install the windows version 1.6.1 several times unsucessfully with the message that “the download didn’t seem to be a valid MSI package and that I would better contact the vendor about”.
    Unfortunately the oficial site of TortoiseSVN dont’t give me any chance of doing that.
    Any suggestion?
    Tks for any information

  • http://TomBrander.wordpress.com Tom Brander

    Great article, I’d like to extend the question a bit however. I’m at a very basic level but building my new development environment. As a lone wolf developer with MySQL, and using BRIT, a sub project of eclipse and I have no version control experience… I’ve barely got my hands around eclipse. And I intend to use it for most languages, Java, Python etc..(currently in a windows environment.) I also have a collection of SQL scripts that I can see getting out of control rapidly.

    Friends have recommended SVN but I’m very wary of how to start, and how to integrate it into my environment (Eclipse, MYSQL, etc.) And is it what I ought to do? Advice??? Remember very basic here!!!

  • http://friendfeed.com/guercheLE Luciano Evaristo Guerche (Gorše)

    I would recommend you:

    1) VisualSVN
    http://www.visualsvn.com/download.html

    2) VisualSVN Server
    http://www.visualsvn.com/server/

    3) Git (from Linus Torvalds)
    http://en.wikipedia.org/wiki/Git_(software)
    http://git.or.cz/

    4) Bazaar (from Canonical Ltd., the maker of Ubuntu)
    http://bazaar-vcs.org/


    Luciano Evaristo Guerche (Gorše)
    Taboão da Serra, SP, Brazil

  • http://codebetter.com/blogs/peter.van.ooijen/ pvanooijen

    As stated in the post I found the learning curve not that steep at all. The help files of tortoise are very very good.

    When it comes to functionality subvesrion far better fits than VSS

  • http://www.programmingado.net ADO.NET programming

    ” Being a one person shop “. So am I. Been using SourceGear Vault ( free for one person). At least the standalone GUI is like VSS (not using it integrated) and SQL Server/webservice based = I can access it from anywhere. Actually I did try Subversion, but as you say, steep earning curve if you’re from the VSS world.

  • Kyle Baley

    AnkhSVN wasn’t ready for primetime when I first looked at it a year ago. VisualSVN is priced at the right side of the “how much billable time is this product going to save me?” equation.

  • Rafael Rosa

    Hi.

    SVN is great, but if your changing tools I would recomend you to take a look at Git. It’s quite new, but seems to be the replacement tools for SVN, and is gaining momentum. It was designed by Linus Torvalds and is used to manage the Linux kernel, Ruby on Rails and many others.

    Besides that, it’s easy to integrate it with SVN repositories, and there’s a new tool to use it under Windows, called MSys on Git. Needless to say, it’s all open source :)

    Official site: http://git.or.cz/
    MSys on Git : http://code.google.com/p/msysgit/

    Best regards,
    Rafael.

  • http://darrell.mozingo.net Darrell Mozingo

    You should definitely give VisualSVN a shot. Integrates seamlessly with Visual Studio and the price isn’t too bad. They make a one-click (or close to it) SVN server install package too, which has worked quite well for me in the past.

  • http://codebetter.com/blogs/peter.van.ooijen/ pvanooijen

    Thanks everybody for your ignore lists.

    @Jeremy: Yes I did notice that one. And that’s quite a powerfull tab. The nice thing about tortoise that it’s UI adapts so wonderfully well to what’s (not) possible. Very, very intuitive

  • karl

    Here’s my ignore list:

    log bin obj Logs *.user *.suo Thumbs.db *.Publish.xml _ReSharper* *.resharper globals_user.php *.sqlite.db db/schema.db tmp *.class *.iws out

  • http://gabriel.lozano-moran.name Gabriel Lozano-Moran

    Try AnkhSVN and to be more specific one of the pre-release versions of one of the nightly builds of version 2.0.

    http://ankhsvn.open.collab.net/servlets/ProjectDocumentList?folderID=199&expandFolder=199&folderID=215

  • Jeremy

    Some other useful wilcards for svn:ignore properties on folders:

    *.suo
    *.FileList.txt
    *.FileListAbsolute.txt
    Thumbs.db
    build.force

    By the way, have you noticed yet that Tortoise adds a “Subversion” tab to the regular Windows Explorer folder properties dialog? This is very useful as it lets you add all your ignore properties to the root folder, and apply them recursively down the tree.