Updated Git but still showing old version

git, macos, terminal, updates

Solution

Run the command:

which git

You'll probably see `/usr/bin/git` -- the Apple supplied version. This will be because `/usr/bin` appears in your `PATH` environment variable before `/usr/local/git/bin`. You can verify this by running the command:

echo $PATH

If that is the case then run this command:

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

and then try `git --version` again. You should now get `1.8.4.2`. This hasn't fixed it permanently yet though. You'll need to add the `export PATH=...` line to your `~/.bashrc` so that it gets set for every shell.

Problem

I downloaded and installed Git 1.8.4.2 from this link: http://git-scm.com/downloads. However, when I run `git --version` from the Terminal I get: ``` [~/workspace/ruby]: git --version git version 1.7.4.4 ``` I've tried restarting the terminal and my computer. I then tried using the info at https://code.google.com/p/git-osx-installer/wiki/Uninstall. I did the following in the terminal from within /usr: ``` sudo rm -rf /usr/local/git sudo rm /etc/paths.d/git sudo rm /etc/manpaths.d/git ``` I then ran the new git .dmg file again but am still getting 1.7.4.4 when I run `git --version`. I suppose there's something going on here with the Mac filesystem that I don't understand. Any help would be greatly appreciated!

Original source

Related problems