Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I upgraded to OS X Mountain Lion and found out SVN is no longer present. I use Netbeans 6.9.1 in conjunction with Apache's SVN.

How can I get it back and working?

share|improve this question
add comment

migrated from stackoverflow.com Jul 30 '12 at 6:34

This question came from our site for professional and enthusiast programmers.

12 Answers

up vote 139 down vote accepted

Install the latest Xcode from the Mac App Store.

Go to Xcode » Preferences » Downloads » Command Line Tools » Install.

If you don't want to download/install Xcode, you can always just download Command Line Tools for Mountain Lion from Developer Downloads.

share|improve this answer
    
For anyone else who finds it doesn't work, I had to close my terminal window and open a new one before SVN would stop complaining about bad versions after installing the CLT from inside Xcode. –  Jeremy Clarke Nov 26 '12 at 18:18
add comment

Also checkout Homebrew for these type of packages :

brew install svn
share|improve this answer
1  
Use this to get svn 1.7 on OSX Lion –  olore Oct 29 '12 at 16:11
add comment

If you have Xcode installed and if you use bash :

$> vi ~/.profile

add this at the end of your .profile PATH="${PATH}:/Applications/Xcode.app/Contents/Developer/usr/bin/"

$> source ~/.profile

It should be working

share|improve this answer
    
I initially +1'ed the accepted answer, but I added a +1 here because this worked without having to install anything (which may only have "installed" what was already there anyway.) –  JMD Nov 15 '12 at 15:29
    
You need to have Xcode installed in order for this to work. Also if some other software doesn't use the same environment as your user it won't be able to find svn (or any other package supplied by Xcode). –  Javier Parra Aug 26 '13 at 19:22
    
yeah, but if you install xcode it's not enough -- thanks jfgrang –  Joanna Bryson Oct 2 '13 at 18:50
add comment

XCode will only install SVN 1.6.18 (r1303927). But you can easily install Subversion from Apache. Just download the source files at http://subversion.apache.org/download/#recommended-release, unpack and go into Terminal. Navigate to the folder you just unpacked via

cd /path/to/folder

(you can drag & drop the folder from Finder into Terminal). Then type

./configure

wait

make

wait quite some time

sudo make install

However you might need to change your PATHS by going to /etc

cd /etc

and open the PATHS-File

open paths

In my case, the old installation was in /usr/bin/svn (you can check that with "which svn"), the new one is in /usr/local/bin. Both are in the PATHS-file, but in the "wrong" order.

share|improve this answer
    
Nice to see the command-line 'make' answer. However, it is worth noting that this method very well may require (unmet) pre-requisites, such as BerkeleyDB and SQlite. Be prepared to grab other software from the internet to support this method. –  cixelsyd Nov 29 '13 at 4:12
add comment

You can also install the SVN and other command line tools without installing the full xcode as per this article:

http://blog.grapii.com/2012/08/svn-missing-in-mac-os-x-10-8-mountain-lion/

share|improve this answer
    
Agreed. This is a better answer; download 116MB (Command Line Tools) instead of 1.5GB (XCode). –  Omar Dec 2 '12 at 5:20
add comment

You can install one of the binary distributions available at

Apache Subversion Binary Packages - Mac OS X

I've chosen the WANdisco distribution myself. Keep in mind you need to stay on the same major version as Netbeans use, if you are touching your working copy from both NetBeans and the command line. So if NetBeans 6.9.1 is still using Subversion 1.6, you should go for Subversion 1.6.18, not 1.7.5. Or upgrade to a newer NetBeans version with Subversion 1.7 support.

Update: Looks like NetBeans svn support is interacting with the command line client, and supports svn 1.6.x and newer: Guided Tour of Subversion - Netbeans. I would go for the newest 1.7.x version then.

share|improve this answer
add comment

You can always install Subversion through MacPorts.

sudo port install subversion
share|improve this answer
7  
Xcode's command-line tools are a requirement for MacPorts to work, so: no CLI tools, no subversion, whether by compiling it by hand or through MacPorts. –  Alex Reynolds Jul 26 '12 at 23:43
    
Error: Port subversion not found. I am using MacPorts 2.1.2 on Mountain Lion. –  Kees de Kooter Nov 12 '12 at 10:35
add comment

If you install through XCode you'll get svn 1.6.x. If you need 1.7.x you'll have issues with http urls of repositories so you'll need to install neon as well. This is my blog post about how to do this (the first part is why)

http://nemanjakovacevic.net/blog/2013/01/svn-android-pre-compiler-and-mac-os-x-pita-combination/

share|improve this answer
add comment

Currently there are many problems with svn 1.7.5 on Apple's Mountain Lion. The svn version of the Apache site has a wrong Neon version (causing svn: E170000: Unrecognized URL scheme for http*). The command line version of WANdisco has problems and is therefor not ready, while CollabNet does not have a build for OSX Mountain Lion.

The GUI version of Syncro is up-and-running for 1.7.5, command line versions are not.

The best is to stay on the 1.6 until all problems are solved.

share|improve this answer
add comment

It may be present in /opt/subversion/bin. If so, you can add that directory to the PATH environment variable in your ~/.bash_profile file.

share|improve this answer
add comment
sudo ln -s  /Applications/Xcode.app/Contents/Developer/usr/bin/svn /usr/local/bin/
share|improve this answer
add comment

SVN May already be installed but it may not available in Terminal because SVN is not included in the path.

In 10.8, they moved SVN to Application folder. You need to add this folder to the /etc/paths file so it is available in Terminal.

enter code heresudo nano /etc/paths /* This will prompt for password. Enter correct password

In the nano editor add the following line at the end of the file

/Applications/Xcode.app/Contents/Developer/usr/bin

Use Control + O to write the files and Control + X to exit Nano Editor.

Quit Terminal ( use Control + Q) and restart. Type SVN Help and you will see that SVN is now available in Terminal Window.

For more help

share|improve this answer
add comment

protected by slhck Sep 23 '13 at 10:34

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.