I installed Git on my Mac but I do not know how to run it or access it. From the terminal I type git but it says "command is invalid."
I downloaded git from http://code.google.com/p/git-osx-installer/downloads/list?can=3 and I downloaded the package "Git Installer 1.7.3.5 - OS X - Leopard - x86_64."
The content of the package is the following:
When I execute "setup git PATH for non-terminal programs.sh," I get the following messages:
No change to PATH in ~/.MacOSX/environment.plist
~ /Volumes/Git 1.7.3.5 x86_64 Leopard /Volumes/Git 1.7.3.5 x86_64 Leopard -MacBook-Pro:Git 1.7.3.5 x86_64 Leopard$ $PATH -bash: /usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec: No such file or directory
The content of my profile file is the following one:
# System-wide .profile for sh(1)
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
The git-osx-installer that you used should have installed git into /usr/local/git
. See if you can cd
into that directory. If you can, then check that your PATH
was correctly set by running echo $PATH
from the terminal and making sure that you see /usr/local/git/bin
in the included PATH
. If not, you need to add it to your PATH
.
Did you run the included shell script setup git PATH for non-terminal programs.sh
?
git-1.7.3.5-x86_64-leopard.dmg
, which should be located in your Downloads
folder./Applications/Utilities/Terminal
cd /Volumes/Git 1.7.3.5 x86_64 Leopard/
./setup git PATH for non-terminal programs.sh
and hit Enter to run the shell script. Note: Once you type ./setup
you can hit the Tab key and it will autocomplete for you.echo $PATH
/usr/local/git/bin
in your PATH.Open Terminal and issue the following commands:
echo "/usr/local/git/bin" > git
sudo mv git /etc/paths.d
When you run sudo it will ask for your OS X password.
After issuing those two commands, you should be able to open a new Terminal window and see /usr/local/git/bin
when you run echo $PATH
.
For this to work you have to have the following in /etc/profile
, which it does by default:
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
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