Previous version of GIT was I decided to update to a newer version

Installer showed it was installed, but when checking the version number in the terminal it showed that it was still version

Currently I'm not the only one with this problem.

I've already checked if the paths are ok in .bash_profile.

4 Answers 4


check which directory the git version that you want is in... mine was in usr/local/git/bin

in order to add this to the PATH accordingly (even though it was already theoretically in the PATH, I had to add it at the beginning to take precedence over the git in the other folder) I added the following lines to my .bash_profile:

PATH = "/usr/local/git/bin:${PATH}"
export PATH

I then quit terminal and started it up again to give it a chance to piece together the new PATH and it worked for me.

For anyone who is a total noob like me and didn't know how to access .bash_profile, this is how I got to it (using vim text editor):

vi ~/.bash_profile

Did get installed into a directory that is later in your path than the directory containing I'm assuming (perhaps wrongly) that you have both versions installed in different directories.


My $PATH was looking like:


I'checked some files like : .bash_profile/.profile/.bashrc there were some export $PATH declarations.

/usr/bin/git --version
=> git version

/usr/local/git/bin/git --version
=> git version

First I removed the export PATH declarations. They were messing things up.

It is kind of strange that the uninstaller of v1.7.5.4 is locating git at /usr/local/git and it is installed here at /usr/bin/git. I always used the official installer.

Then I read somewhere else that Xcode also installs git (think this should be the /usr/bin/git). So I'm not planning to remove this one.

So first I removed all my export PATH declarations from .bash_profile/.profile/.bashrc. This makes my PATH looks like:


Somewhat shorter. When I did which git' it gave me /usr/bin/git. This isn't the version I want. So I went back and changed my PATH to


by adding this line:

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

to .bash_profile

First open a new terminal window to test git --version or which git or if you want to test those commands in the same terminal type in first source .bash_profile to enable your changed in the .bash_profile file

/usr/local/git/bin (the version) will be found first ('which git' resulted in /usr/local/git/bin/git)


So, this is a bit old, but I have the answer to your original question. The answer is here: http://code.google.com/p/git-osx-installer/issues/detail?id=67

The problem isn't with .bashrc or .bash_profile. The problem is in /etc/paths and /etc/paths.d. The OS X installer adds git to /usr/local/git/bin. It also adds /usr/local/git/bin to the /etc/paths.d.

If I understand correctly, /usr/bin precedes /usr/local in /etc/paths, so the version of git in /usr/bin/git (the Xcode version) is used. However, for some reason adding a trailing slash to the entry in /etc/paths.d will force the system to use the /usr/local/git/bin version instead.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .