Homebrew git reporting older version

githomebrew

I have just upgraded git. It's now a symlink to the Cellared most recent version.

$ ls -l `which git`
/usr/local/bin/git -> ../Cellar/git/2.14.1/bin/git

However

$git --version
git version 2.11.0 (Apple Git-81)

Do I have two different versions installed at once? How can I clean up the remnants of the Apple Git-81 version?

Best Answer

In ~/.bash_profile you should amend PATH to prefer binaries supplied by homebrew. You can do this with the line:

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

After changing .bash_profile you will need to open a new Terminal.app window to see the change take place. Alternatively, you can source ~/.bash_profile to load in the profile into the current session.