I installed the GitHub UI for OS X from here: https://central.github.com/mac/latest. As part of the installation I get an option to "Install Command Line Tools". On doing so it places the relevant assets under /usr/local/bin. I assumed it would register git in the PATH variable as well so that I could run it from the terminal if needed. However it doesn't work from the terminal, instead if I run 'git' in terminal, I get prompted to install XCode.
Am I assuming something incorrectly here? Also tried installing git from here: http://git-scm.com/download/mac. After the installer completed successfully, I still can't seem to be able to use git from the terminal.
UPDATE: my PATH variable has the following:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin
As mentioned in "git on Mac: replace Apple XCode CLI git with symbolic link to latest git install?", it dpeends on the order of the folders in the PATH
environment variable.
- XCode CLI installer puts a copy of git in
/usr/bin
- Reinstalling the latest git from git-scm.com put git in
/usr/local/git/bin/git
If git command line is installed in /usr/local/git/bin
, make sure to put that in first:
PATH=/usr/local/git/bin:$PATH
Just download these tools running command in terminal:
xcode-select --install
If it doesn't help you try to download them manually form apple developer site: https://developer.apple.com/downloads/index.action?=command%20line%20tools#
It helped me.
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