Updating Subversion on Mac OS X 10.8.x

A couple weeks ago I started using subversion via the command line on my laptop. I was able to quickly checkout my project and start developing immediately without any trouble. Then I decided I wanted some GUI support for subversion. I already was using SmartSVN for other projects and figured I should have all of my subversion projects managed by one tool. So I decided to point SmartSVN to my local working copy of the project and it proceeded to load up all the metadata into the app. Everything looked as though it had gone smoothly at this point.

Next, I went to Update the source and was prompted with a version mismatch error. The error something along the lines of the working copy was an older version and I needed to “upgrade” it to be able to use it with SmartSVN. That’s when I realized I obviously was running two different versions of subversion. A quick check proved that was the case, since I was using 1.7.x with SmartSVN 7.

tony@~/Documents/project$ /usr/bin/svn –version
svn, version 1.6.18 (r1303927)
compiled Aug 4 2012, 19:46:53

It turns out that Mac OS X 10.8.x runs Subversion 1.6.x. I proceeded with the upgrade of the working copy.

The next day, I started working on the project again, but my part of my workflow is to compile and run the project via command line with Ant scripts. When I ran the script, it immediately failed. I checked out the script and it was running svn info but it eventually failed with an error message. At this point, I knew it was another versioning issue with subversion. So I had to update Subversion on Mac OS X. Here’s what I did:

Downloaded Subversion from Apache and extracted. If you’re following these commands, make sure you replace the version number with the latest version.
cd ~/Downloads/
curl -o subversion-1.7.9.tar.gz http://www.bizdirusa.com/mirrors/apache/subversion/subversion-1.7.9.tar.gz
tar -xvf subversion-1.7.9.tar.gz
cd subversion-1.7.9

Configured and installed
./configure –prefix=/usr/local
sudo make install

At this point, I had a full working copy of subversion 1.7.x available for use.
/usr/local/bin/svn –version

One thing to note is that I still was using the older version of subversion by default. A quick svn –version would have shown that I was still at 1.6.xTo overcome this I updated my PATH with the new location.

vim ~/.bash_profile

Added in:
export PATH=/usr/local/bin:$PATH

Saved and then sourced it.
$ source ~/.bash_profile

Now when when I execute svn –version I see 1.7.x. You can also:
$ which svn


Tagged , ,

Leave a Reply

Your email address will not be published. Required fields are marked *