Installing Subversion on MacOS

Recently, I needed to upgrade the Subversion client I had installed on my Mac (my personal development machine) to a more recent version. The issue that came up was an incompatibility between my IDE’s Subversion plugin and the command-line version I had previously installed.

When checking out files within the IDE (or even doing updates, for that matter), the sandbox would have its version flags switched, causing my command-line client to no longer work. It got frustrating, as different parts of the sandbox were done in different editors (a Java IDE for one project, a text editor for another, etc), and keeping my sandbox up-to-date was proving tedious.

So, the solution was to update the Subversion client on the command line. Doing so was very easy, though it required building from source (I haven’t been able to find a recent binary installer for the Mac).

Building Subversion from Source
First, download two files: subversion-1.4.3.tar.gz and subversion-deps-1.4.3.tar.gz. Uncompress both of them in the same place (for instance, create a folder called Subversion, place both files in there, and then type “tar xf [file]” for each). This will create a single directory called subversion-1.4.3 with all of the software we’ll need.

Second, in your Terminal, go into this directory and type “./configure”. This will attempt to setup our build. If any problems occur, this will tell you (for instance, I was missing an updated version of apr).

Third, if configure fails, it’s probably due to a missing dependency. For me, I needed to go into the subversion-1.4.3/apr directory, run “./configure ; make” and then, as root, “make install” to get that taken care of. After each dependency you build in this way, re-run the configure script until it completes without errors.

Finally, once the subversion-1.4.3/configure script has completed setting up our build without errors, type “make” to build the subversion software. This is probably the most time consuming and can take a few minutes. When finished, type “sudo make install” to install the Subversion client as root.

And that’s it! To double check that your install worked, type svn –version. If you get a “command not found” error, it’s probably due to your PATH not including /usr/local/bin. To fix this, just edit your ~/.bash_profile, locate the line with $PATH on it, and add “:/usr/local/bin” to the end of the line. Then, type “. ~/.bash_profile” to re-load your PATH, and try it again.

Downloading a Binary
As I mentioned earlier, I had originally opted for the easier path of downloading a pre-built binary of Subversion and installing that. Unfortunately, I haven’t been able to find a recent binary anywhere, and the best I’ve found is version 1.3 (which is where my incompatibilities came from). If this isn’t a problem for you (i.e. you don’t have an IDE that will cause you problems), I suggest going the binary route, as it’s much easier.

Hope you found this useful.

Additional Resources
Prebuilt binaries up to version 1.3
GUI Subversion client (svnX)
Great tips on everything Subversion for the Mac
How to backup a Subversion repository

  • http://open.collab.net Guido

    We now have a Subversion 1.4.3 command line client available on openCollabNet (CollabNet’s online community for Subversion users).
    Check out: http://downloads.open.collab.net/binaries.html

    best,
    Guido

  • http://www.dracoware.com ryan

    Cool: a binary simplifies this process quite a bit. :)