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!
Download the installation file from the Git website. Run the installation and follow the install wizard to update Git to the latest version. Note: Using the install wizard to update Git overwrites the current installation.
Check If Git is Installed You can check whether Git is installed and what version you are using by opening up a terminal window in Linux or Mac, or a command prompt window in Windows, and typing the following command: git --version.
Git can be installed on the most common operating systems like Windows, Mac, and Linux. In fact, Git comes installed by default on most Mac and Linux machines!
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With