Choose which binary is default binary on Mac OS X Mavericks

1

I have installed the latest SVN 1.8 via homebrew on my Mac. However now If I run svn --version I get back that I have 1.7. Next thinng I run which -a svn which then shows me I have it twice:

/usr/bin/svn
/usr/local/bin/svn

If I run /usr/local/bin/svn --version I get back 1.8

How do I now tell my MAC that the default binary to use is /usr/local/bin/svn and not /usr/bin/svn?

Dominik

Posted 2014-07-30T11:56:33.827

Reputation: 143

1By deleteing /usr/bin/svn? ;) – duDE – 2014-07-30T12:13:04.620

I am not sure if this is a smart idea, since this comes with Xcode and I don't know if I will face some issues with that. Is the binary that is the default arbitrary? I can't imagine, it has to be defined somewhere, just where? – Dominik – 2014-07-30T12:30:42.477

Answers

1

Symbolic link is the solution, take a look: https://stackoverflow.com/questions/11198782/svn-use-from-default-path-usr-bin-instead-of-opt-local-bin

You already have svn in two locations:

   /usr/bin/svn
   /usr/local/bin/svn

If you create symbolic links for svn in /usr/local/bin with the same name, it will effectively remove the binaries from the macport.

or else you have to create symbolic link with different name which is not very useful.

How about having an alias that points to the one you want to use:

 alias svn=/usr/bin/svn

duDE

Posted 2014-07-30T11:56:33.827

Reputation: 14 097

0

Edit your PATH variable. Put /usr/local/bin before /usr/bin and possibly before many other dir's, as this allows anything you have specifically compiled/installed to override the system defaults. Obviously, take care that you know what's in /usr/local/bin first, but it sounds like you do.

jimtut

Posted 2014-07-30T11:56:33.827

Reputation: 832