Removing git from /usr/bin

I'm on OS X 10.8 and I'm using Homebrew. brew doctor tells me that I have 2 git installations, one in /usr/bin and the other one in /usr/local/bin.

Is it a bad idea to remove git from /usr/bin? If no, what's the best way to remove git and the following components from /usr/bin to only use Homebrew's?

git
git-cvsserver
git-receive-pack
git-shell
git-upload-archive
git-upload-pack
gitk

Solution 1:

What's the best way to remove git and the following components from /usr/bin to only use Homebrew's?

Your shell uses the non-Homebrew binaries only because they come first in your $PATH.

So, in your ~/.bash_profile (or ~/.profile, depending on which you use), add the following line:

export PATH=/usr/local/bin:$PATH

Remove all other PATH assignments that would put /usr/local/bin after $PATH, because then, /usr/bin would come first, and your shell would use the system git.


You could remove the Git installations in /usr/bin, but it's up to which one to choose. I believe at some point you used the git-osx-installer, which put it there, but there's no problem keeping both installations. You just have to know which one you want to use.