I’ve previously written about managing your Subversion repositories via the TortoiseSVN client.  TortoiseSVN integrates with Windows Explorer and provides a really slick way to do things like view the status of your source code, update your Subversion working copy and commit change.

But as slick as it is, TortoiseSVN requires one to bounce between their IDE and the Windows Explorer.  You’re right!  A simple, two-second step, a mere ALT-TAB, shouldn’t be that disruptive but, for me, it is and it keeps me from committing my changes as often as I probably should.  Perhaps this is a flaw in the way I work, but it is, without a doubt, the way I work.

There are two players in the “Subversion Source Control Provider for Visual Studio” space.  There’s VisualSVN and there’s AnkhSVN.   Until this week, I had heard nothing but good things about VisualSVN and AnkhSVN reviews weren’t nearly as favorable. 

I ended up trying VisualSVN for over a week and, frankly, I was disappointed. I deserve to get negative feedback about publishing the following comments without any supporting documentation but I found VisualSVN to be sluggish and I felt it called up TortoiseSVN dialogues (rather than handling the file management itself) far too often.  Since so many folks like the product, I would be willing to bet I simply had a very bad first go (although I did spend over 1 week with the product.) All the same, it is uninstalled, the $49 are still burning a hole in my pocket and, well, there was no harm done. 

I reverted to my old ways of not using source control effectively by avoiding Windows Explorer and TortoiseSVN and then, on my birthday, AnkhSVN 2.0 Final was released.  Though folks grumbled about the previous version, 2.0 is a near rewrite of the original and is now a full Source Control Provider Integration Package rather than a Visual Studio Add-In. With commercial backing from CollabNet and renewed open source enthusiasm, AnkhSVN 2.0 seemed to deserve a look so I looked…

Quick Start

1. Download AnkhSVN 2.0 here and run the install package.  If you want the latest and greatest, check out the daily builds

 

2. The AnkhSVN download page says to install and then “Start Visual Studio and choose Tools -> Settings -> Source Control and make sure AnkhSVN is the active source control provider.”  Actually, you want Tools -> Options rather than Settings, but you would probably figure that out on your own.  All the same, AnkhSVN was already configured/selected.

 

3. Open an existing solution and noticed the new “Pending Changes” windows (also available via View -> Show Pending Changes.)  Enter your repository URL into the empty “Working on:” field and, if you are as lucky as me (after all it was my birthday), everything should just work. 

image 

 

4. This step is optional, but inevitable. I think. After about 20 minutes of playing with AnkhSVN you’re probably going to want to hook up your favorite diff tool.  If your favorite diff tool is WinMerge, perform the following: Go to Tools -> Options -> Source Control -> Subversion -> External Diff Path = “C:\Program Files\WinMerge\WinMergeU.exe” “%base” “%mine”

image 

 

5. Once you are setup, you will see green check-marks alongside items in the Solution Explorer window.  And, as you start to make changes, you will see modified items added to the Pending Changes window.  This, my friends, is  a great feature!  Now you able to manage all of your changes in a single location rather than having to navigate through Windows Explorer or even the Solution Explorer. In another life, StarTeam provided me with similar functionality by allowing me to flatten out the folder hierarchy and then sorting by status, but the Pending Changes windows is 100 times better.  Sure, you can manage your commits via the Solution Explorer, but I’m not going to. The Pending Changes view is also great since the Solution Explorer doesn’t always conveniently show you the status of your files.  Take the screen shot below, for example.  Collapsing the EmailTemplates folder leaves me no insight into the state of the files within.  (For the record, I prefer VisualSVN’s Solution Explorer display.)

 

image

 

     

     

     

    Side note: If I could do it all over again, I really wish I followed the posted download instructions.  The suggested setup sounds straight forward enough, but trying to replicate the steps now, after already setting up, is seemingly impossible.  The instructions can be firmed up for clarity (see prior example referring to incorrect menu names), but I would have liked to give them a test run without jumping the gun and setting up my own way first.  If you do follow the published install instructions, let me know how it goes for you as I simply can not make heads or tails out of some of the steps.  One thing which seems to be missing — perhaps because of my impatience — is the persistence of the Subversion repositories added to the Repository Explorer.  It is really nice a version of the Repository Browser is built in, but it seems odd that repositories would need to be reestablished each time you open a solution.  Anyhow, it is probably my fault…

    Wrap Up

    Thus far, I am pleased with AnkhSVN.  For those of you who tried out earlier versions and were disappointed, try again.  Here’s a partial list of what’s new in AnkhSVN 2.0:

    • For Microsoft Visual Studio 2005 and 2008.
    • Built on Subversion 1.5.0 via SharpSvn.
    • Pending changes window; subversion status and commands available in one place
    • Full support for Visual Studio 2005 and 2008; AnkhSVN is now a SCC package instead of just an addin
    • Better log viewer
    • Merge support
    • Property editor
    • AnkhSVN now supports most project types previously unsupported via the SCC api
    • All solution explorer actions (rename, copy&paste, drag&drop) keep subversion history now
    • Enhanced build process and setup
    • Automatic check for updates
    • And last but certainly not least end user documentation

    For more information about AnkhSVN, check out the project’s home.

    kick it on DotNetKicks.com

    6 Comments to “Getting Started with AnkhSVN”

    1. [...] Unfortunately, we kind of blew it with the time allotment as my two talks, one on AnkhSVN and the other on Inno Setup, took 5 minutes and then 45 minutes respectively.  All the same, [...]

    2. [...] – bookmarked by 2 members originally found by laois90 on 2008-12-09 Getting Started with AnkhSVN http://johnnycoder.com/blog/20.....h-ankhsvn/ – bookmarked by 5 members [...]

    3. Brett Coburn says:

      Thanks for the article — I hadn’t used WinMerge before now, but it is an unbelievably helpful tool when coupled with AnkhSVN.

      One note for those (like me) who are prone to copy and paste: the smart quotes around the WinMerge path in this article will paste into Visual Studio, but they don’t work. Change them to standard quotes when setting up AnkhSVN and everything works as expected.

    4. Ben Griswold says:

      @Brett Coburn – Thanks for calling out the help information regarding the pasted quotes and I’m glad you found WinMerge helpful. I think it’s the best.

    5. Benabdallah says:

      Thanks :) Always forget how to do it this time i’ll bookmark it :)

    6. Ben Griswold says:

      @Benabdallah, Glad to help. :)

    Leave a Reply

    You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>