简体   繁体   中英

error with git (-bash: git: command not found)

I am having trouble with git command. I'm getting -bash: git: command not found . It's reported as installed when I run $ gem list , and i've put its path on my .profile as you can see below. I just don't understand how come it doesn't work. Thanks for the help

# MacPorts Installer addition on 2012-10-11_at_19:01:44: adding an appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with MacPorts.
export PATH=${PATH}:/usr/local/mysql/bin

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

# git path

export PATH=$PATH:/usr/local/git/bin

The git you have installed is a Ruby Gem that is used to access Git features from within Ruby. It does not come with the actual Git and as such does not include the command line git (I'm actually not sure if the Gem does not even need a normal Git installed).

So what you need to do is to download and install Git itself .

On Mac: The best solution is to install Xcode and then go to Xcode - Preferences, and the Downloads. Here install Commandline Tools and you are good to go.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM