We want to warn our blog followers first, this is going to be quite a bit more techy so if you are not interested in those kind of things, you'll want to avoid this post, otherwise, read ahead!
We recently discovered after upgrading to OS X Mountain Lion here at the nest that when we went to use SVN that the command was no longer found. It seems that Apple has removed the binary from normal OS X installs.
SVN, or subversion, is an open source version control system. This helps users, generally developers, keep versions of files and code as they work on a project together. If you are not familiar with version control, Wikipedia has a brief intro to it. Another very popular tool used in the open source community for version control is Git used freqently on Github.
Since SVN is more of a developer tool, Apple has now moved it to be part of their Xcode developer package. You'll need to head over to the Mac App Store and download it if you don't have it already.
Now that you have it installed, you'll notice that the svn command still doesn't work in your terminal.
We still need to add the path that it is installed in to a file that your computer looks for applications in so it knows where to look. The Xcode binaries are put in the folder /Applications/Xcode.app/Contents/Developer/usr/bin. That means it's time to fire up your trusty terminal and get your hands dirty.
Once terminal is open, we need to edit the file /etc/paths (there are other files you could edit too that would accomplish the same thing, but we choose this one so it applied to all users on our machine). You can use vim, nano, or whatever your favorite is. We're fond of nano so we're going to use that.
To edit the file you'll want to type "sudo nano /etc/paths". We need to use the sudo command since this is a core system file and we need higher level privileges to do so. You'll then be prompted for your password. This is your normal OS X password you use when installing software updates and perform other administrative tasks.
Once the file is open, use your arrow keys to move to the bottom of the file and make sure you are are on a new line, if not go to the end of the last line and hit enter. Type or paste in the path mentioned above of /Applications/Xcode.app/Contents/Developer/usr/bin. Once done, exit and save your changes by hitting Control + X on the keyboard, then selecting yes to save changes by hitting Y and then enter to save over the file. Your paths file should look similar to the image below.
At this point the file should be saved and everything so now you just need to reboot Terminal to get back to using svn. After quitting (can use Command + Q if you like) and restarting you should be able to use svn just fine!
Article Categories: How To, Development