不工作git在终端



我尝试使用git。但是终端写入:

    ROUTER-SETTINGS:~ ILOVEME1199$ git
git: error: can't exec '/Applications/Xcode.app/Contents/Developer/usr/bin/git' (errno=No such file or directory)

我不确定您的路径中是否有git(或者可能已经安装)。它在OS X上可能会令人困惑,所以这里是最好的资源。引用答案:

直接下载[原始git包][1]。安装程序将在/usr/local/git下安装git(您需要停用安全性)选项来运行安装程序)。

有一个预安装的git包装器在/usr/bin使用的Xcode不安装Xcode不能工作。你需要逃跑/usr/local/git/bin/git显式或将PATH变量更改为在/usr/bin之前包含/usr/local/git/bin !

创建/编辑您的~/.profile:

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

[1]: http://git-scm.com/download/mac