错误:无法找到实用程序"git",无法找到开发人员工具或PATH

wen*_*nyc 13 git xcode7.3

我已经将Xcode版本更新为7.3.1.当我使用' git status'时,我发现错误!如下:

$git status
sh: line 1:  1601 Segmentation fault: 11  /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / -find git 2> /dev/null
git: error: unable to find utility "git", not a developer tool or in PATH
Run Code Online (Sandbox Code Playgroud)

谢谢高级!

Ged*_*tka 53

这也发生在我身上,升级到High Sierra和XCode到9.这个序列修复了它.

xcode-select --install
sudo xcode-select -s /Library/Developer/CommandLineTools
Run Code Online (Sandbox Code Playgroud)

https://davidwalsh.name/fix-git-high-sierra-upgrade上找到了这个答案 (文章和评论.)


小智 50

我有同样的问题 - 我退出了我的bash会话(关闭了终端)并启动了一个新的并修复了它.


yor*_*mmi 5

最好的解决方案是下载并安装它 - 即使你认为它已经安装了:https://git-scm.com/download/mac

  • 如果你安装了Homebrew,你可以通过`brew install git`命令安装Git.请看:https://git-scm.com/book/en/v1/Getting-Started-Installing-Git (3认同)