Different versions of Git on Mac OS Yosemite
I guess Git on my macbook was of version 1.8.4, because I tried
git --version git version 1.8.4 echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin whereis git /usr/bin/git
later I try to upgrade the latest version of Git to 2.0.1, I download and install from
Since this installer installs Git to
/usr/local/git, and append the path to
$PATH, so now
echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin
I also replace the binary file to
sudo cp /usr/local/git/bin/git /usr/bin/
And I logged out and logged in back, but found the following strange situation:
/usr/bin/git --version git version 2.0.1 git --version git version 1.8.4 whereis git /usr/bin/git
Where does my mac os look for when I type
git --version? Where is my previous version 1.8.4 located and how can I delete it and replace it with my new version?
One Solution collect form web for “Different versions of Git on Mac OS Yosemite”
The correct way to use another version of git would be to put it first in the path. Edit the file that appends
/usr/local/git/bin to the path so that it prepends it instead.
Most likely there is something like the following in either your
Change it to:
sudo cp /usr/local/git/bin/git /usr/bin/ is probably not a good idea, as other software may expect the default version to be there. A software update may also replace it.