I needed to use SVN on a new installation of Mountain Lion OSX on my Macbook Pro and initially assumed it would be there because I already had Xcode installed however it was not or was not located in my path. After playing around in the Xcode interface for a moment I located the Command Line Tools package available for download which ended up installing svn on the command line. Below I describe how to verify if SVN is installed on OSX and explain how to install it if it does not already exist.
Open a Terminal window on OSX and type the below to verify if SVN is already installed.
Verify SVN Is Installed On Mountain Lion:
- Alexs-MacBook-Pro:~ alex$ which svn
- Alexs-MacBook-Pro:~ alex$
In the example above I ran the command above after installing the Xcode Command Line Tools package so it returned the location of the svn application. If svn was not installed then it would have simply returned nothing and taken me back to a command prompt without any output.
If svn is not installed make sure you have Xcode installed by opening the App Store and searching for Xcode as shown in the below example image of the Apple App Store on OSX Mountain Lion.
Install Xcode Via App Store:
Once you have installed Xcode launch the Xcode application and click on Xcode in the top navigation menu to display the Xcode menu displayed below.
Xcode Sub Menu: Select Preferences
Select Preferences from the Xcode drop down to open the Xcode Preferences window as shown in the below example image.
Xcode Preferences Window: General Tab
Now from the Xcode Preferences window click on the Downloads tab which display the available Xcode package additions as shown below.
Xcode Preferences Window: Downloads Tab
In the example image above you can see the Command Line Tools package is already installed but if you are still reading this article it means you have not installed the Command Line Tools package yet and therefor it will display a Install button similar to the other two packages displayed in the example image above. Click the Install button to install the Xcode Command Line Tools package which will install svn.
Verify that svn was installed by opening a new Terminal window and typing “which svn” which should return the location of the svn application. You should be able to start using SVN immediately on your Mac computer.