Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use Lion, and the svn /usr/bin/svn is 1.6 version. As I need to use subversion 1.7, I installed svn from brew to be installed in /usr/local/bin/svn.

How can I disable the svn* files so that I can use svn from brew?

share|improve this question
possible duplicate of Amending PATH so that /usr/local/bin is ahead of /usr/bin – Mark Jan 29 '14 at 16:14
up vote 13 down vote accepted

There is a better and safer way to specify which version of an executable you want your computer to use without having to modify the executables that came pre-installed on your Mac. It's generally not recommended to alter your default system tools in any way.

You can take advantage of the PATH environment variable, which allows you to list several directories that you want your Mac to search in when looking for executables.

In order to use the latest version of svn, or any other tool you installed in /usr/local/bin with Homebrew (or MacPorts, manually, etc), you want to tell your Mac to first look in /usr/local/bin before it looks in the default /usr/bin. You do that by defining the PATH in your .bash_profile, which is a file that gets loaded automatically every time you open a new Terminal window.

You can write the PATH to your .bash_profile by running this one-liner from the Terminal:

echo 'export PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"' >> ~/.bash_profile

This command takes everything between the single quotes (echo) and adds it (>>) to a file called .bash_profile in your user’s root (or home) directory (~/).

To have these changes take effect, you can either quit and relaunch Terminal, or run this command:

source ~/.bash_profile

If you want to do it all manually, open your .bash_profile with your favorite editor, then add this line to it:


and save it. Then quit and relaunch Terminal.

share|improve this answer
This should be the accepted answer – Brian Colavito Nov 3 '14 at 17:14
I agree; this is better than my answer. I have edited my answer to show that preference. – CajunLuke Jul 19 '15 at 14:06
Is this persistent though? Will it stick after system reboot. – Igor Ganapolsky Apr 5 at 13:04

NOTE: monfresh's answer below is better than mine. While my method will work, it is not recommended to rename or edit system utilities.

When I needed to upgrade from SVN 1.6 to 1.7, I installed my built version (not using Homebrew or Macports, etc.) in /usr/local/bin and renamed all the old svn executables in /usr/bin to (executablename)-1.6.7.

So now which svn gives /usr/local/bin/svn and the old /usr/bin/svn is /usr/bin/svn-1.6.17.

share|improve this answer
Renaming files in /usr/bin just to get them out of the way leaves you open to upgrades restoring them, or breakage of programs that depend on them. Why not just put /usr/local/bin first in your PATH? – zigg Jan 29 '14 at 16:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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