TortoiseSVN for Apple OSX

tortoise_on_osx

TortoiseSVN is my personal favorite SVN client, unfortunately it’s only fully supported on Windows.  With a little bit of hacking, though, TortoiseSVN is usable on OSX.  You can checkout, commit, update view the repo, etc.  At this point there are no overlays or Finder contextual menus.  These instructions are not for the novice user, but chances are if you’re using SVN it shouldn’t be a problem.

Requirements:

1. Crossover or Wine for OSX

2. Subversion server using the svn: protocol (http: doesn’t work yet)

Step 1: Install Crossover/Wine

The first thing you need is either Crossover or Wine.  Crossover is the commercial version of Wine that is already customized for OSX.  With Wine you’ll probably have to learn some terminal commands.  The choice is up to you but for these instructions are for Crossover.  Wine should work the same but I don’t know what the interface is like so you’re on your own.  Please post a comment if you have any tips. After you’ve installed Crossover, download the .msi installer for TortoiseSVN.  My testing has been done with version 1.5.5.  If you have success with a more recent version, please post a comment.

Step 2: Create a Bottle and install TortoiseSVN

NOTE: For these instructions, use the default bottle name of “winxp”  If you use another name for your bottle, you’ll need to adjust the commands appropriately below.

Installing an app in Crossover is pretty easy using the installation Wizard.  Open Crossover and go to the menu item Configure -> Install Software.  Click on the button that says “Install Unsupported Software.”  Ignore the warning and click “Continue” to proceed.  If you are prompted, select the option to install to a “New bottle” and continue. Once you have a bottle created, Crossover will want to know where the installation file is.  Click the install button and select the TortoiseSVN .msi file that you downloaded.  This will run you throught the typical Windows installer.

Step 3: Using TortoiseSVN

Now that you have Crossover installed, created a bottle and have installed TortoiseSVN the big question is “how do I use it?”  The problem is that you normally use TortoiseSVN by right-clicking folders in Windows Explorer.  There is no explorer and there are no Finder contextual menus that have been added.

The solution is to set up some Crossover commands and then save them.  Basically TortoiseSVN supports various windows command-line arguments.  Crossover allows you to save a command and make it appear as a regular OSX application shortcut.  So you just need to initially execute the command, then save a shortcut so you don’t have to re-type it all the time.

Checkout an existing Repository:

1. Create a folder on your Desktop called “jasonrules”  (This will be the test folder used for the rest of the instructions.)

2. Enter the checkout command. To run a windows command, open Crossover and go to the menu item “Programs -> Run Command…”  There is a field for the windows command you would like to execute. The command to checkout is below.  replace USERNAME with your home folder name and MY.SVN.SERVER/REPOPATH with your full svn repo path.  You must keep all double-quotes in the command as they are typed below:

“/Users/USERNAME/Library/Application Support/CrossOver/Bottles/winxp/drive_c/Program Files/TortoiseSVN/bin/TortoiseProc.exe” /command:checkout /path:”/Users/USERNAME/Desktop/jasonrules” /url:”svn://MY.SVN.SERVER/REPOPATH

3.  Click the “Run” button.  You should see the familiar TortoiseSVN dialog appear confirming your action and, if your server requires authentication, you’ll be prompted for your username and password. If successful, you should see the files pulling into your working folder at this point.   You don’t need to save this command because you generally only run it once.

You now have a working copy of your project.  Yay!

NOTE – BEFORE YOU SAVE ANY COMMANDS, GO TO BOTTLE MANAGEMENT AND DUPLICATE YOUR BOTTLE!  There seems to be an issue with Crossover where it doesn’t work when saving multiple commands with the same executable but different arguments.  Most TortoiseSVN commands use the same executable so this creates a problem.  For the moment my workaround is to create a separate bottle for each command.  Hopefully that will be resolved by Crossover.

Updating your working copy:

Once you have a working copy, the next logical thing is to update the project.  Of course if you just checked it out, it should be pretty much up-to-date, however you will use the update command all the time so you want to save it. Follow the same steps that you did for running the checkout command, only using the command below instead.  (Be sure to replace PROJECTNAME with the name of the folder that is now inside jasonrules.)

“/Users/USERNAME/Library/Application Support/CrossOver/Bottles/winxp/drive_c/Program Files/TortoiseSVN/bin/TortoiseProc.exe” /command:update /path:”/Users/USERNAME/Desktop/jasonrules/PROJECTNAME

Click the “Run”button again and you should see the familiar TortoiseSVN dialog.  If all goes well, you will be able to successfully update the working directory.

Since you will want to run update regularly as you work, you should save a shortcut for this command.  To do this, click the “Save Command to Programs Menu” button.  This will create a shortcut icon which you can rename, drag it to your Dock or whatever you’d like to do.  Everytime you double-click this shortcut, the update command that you saved will be executed.

Committing Changes:

The last command I’m going to describe is the Commit command.  Basically updating and committing are the most common operations, so you should be able to do your basic work at this point.  The commit command is run the same as update:

“/Users/USERNAME/Library/Application Support/CrossOver/Bottles/winxp/drive_c/Program Files/TortoiseSVN/bin/TortoiseProc.exe” /command:commit /path:”/Users/USERNAME/Desktop/jasonrules/PROJECTNAME

You should again see the familiar dialog and be able to commit just as if you were working in Windows.  Again, save this command.

Additional Information:

With the three commands I showed you above you should be able to do basic development work using TortoiseSVN in OSX. You will most likely want to repeat the process using your actual working directories and not the jasonrules folder on your Desktop.  One thing to note is that if you work on multiple projects, you’ll have to create separate shortcuts for all of them because the working directory path is hard-coded into the commands.

Obviously there are a lot more commands, branching, merging, patching, etc.  The basic concept behind running these is the same.  You just need to know the correct syntax in order to run them.  The inline TortoiseSVN help lists all of the commands.

I would be interested in hearing from anyone who comes up with more commands, or knows AppleScript and would be able to write contextual Finder menus.  I don’t think it would be too difficult.  The SCPlugin source code might provide some clues.

Please feel free to leave a comment if you used this tutorial and found it helpful (or not).

5 Responses to “TortoiseSVN for Apple OSX”

  1. Lex Robin January 7, 2009 at 4:47 am #

    I recommend you to take a look at smartSVN. It is free and also provides a context menu for OSX. It even provides a fully featured SVN GUI and if it does not is enough for you, you can buy a Professional license to arrive at the SVN heaven.

    • Jason January 7, 2009 at 12:30 pm #

      Thanks Lex. I checked out SmartSVN. It’s actually a nice app. The shell integration on OSX is a bit wonky, requiring you to leave the SmartSVN app open in order to function. If you close SmartSVN, then open it again, it has problems initializing the Finder integration and you have to kill the Finder process. That being said, it’s a nice looking app.

      The one thing that keeps me coming back to TortoiseSVN is the commit dialog. I like being able preview, pick and choose what to commit & deal with conflicts so easily. I haven’t seen any other client that is quite as slick. I’ll admit it’s just what I know and is familiar to me.

  2. Egil January 9, 2011 at 11:56 am #

    Hi – I have tried most of the mac svn clieants but still find TortoiseSVN the best. By adding each command in a .bat file, you may save the commands for running these and then there is no need for the additional duplicated bottles.

  3. Mike Stroven September 13, 2010 at 1:00 pm #

    Ever check out “SynchroSVN” for Mac?

  4. Jason October 1, 2010 at 12:12 pm #

    @mike thanks, that looks interesting I’ll check it out. These days I mainly use the Subclipse SVN plugin for Eclipse or simply the command line. Versions ( http://versionsapp.com/ ) is, to me, currently the nicest looking SVN client for OSX. I’ve found all of the clients I tried for OSX to look good, but are not really stable. Versions seems to be quite reliable, though.

Leave a Reply

Please leave these two fields as-is: