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.
The default path is “C:\Program Files\Git“. If you want the software installed in a different location click Browse and specify a different folder. Click Next when ready to proceed. On this step, you are prompted to provide the name of the Start Menu folder in which the shortcuts for the application will be placed.
How do I know if Git is installed? To see if Git is installed on your system, open your terminal and type git --version . If your terminal returns a Git version as an output, that confirms you have Git installed on your system. If not, you have to download Git for Mac or Windows.
Open setting. json(or File>Preferences>Settings). Navigate to Workspace Settings. Find "Path" and add paths to Git bin and cmd folders.
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!
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.
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