I am new to OS X and cannot find anywhere how to fix this. I installed git but the installation was messed up and I had to remove it. I installed it using the latest git dmg file but whenever I type in
git
I get
-bash: /usr/bin/git: No such file or directory
That is because git is not installed in that directory and instead in /usr/local/bin/git
If I type in the entire path to the directory than I get the correct output.
So what did I do wrong and how do I fix it? Thanks.
I know this is over a year old but just for anyone who experiences this issue:
I had a similar issue after renaming the OS X provided git client and installing using Homebrew. I found the issue was due to the current terminal session. The OP has the correct paths so I wouldn't recommend editing the /etc/paths
file.
If after running which -a git
you see /usr/local/bin/git
everything should be correctly configured, open a new terminal and you should be able to run git
with no errors.
Running which git
should now output /usr/local/bin/git
.
It's not in your $PATH
. It's installed in /usr/local/bin/git
but your path only has
/usr/local/git/bin
. Fixing the path should work.
edit the file /etc/paths
and add a line /usr/local/bin/
echo "/usr/local/bin/" >> /etc/paths
you may have to run this command with sudo
.
Open a new terminal window and type which -a git
. If you see /usr/local/bin/git
listed, you are all set.