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

问题描述 投票:12回答:4

我已经将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

谢谢高级!

git xcode7.3
4个回答
5
投票

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


48
投票

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


40
投票

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

xcode-select --install
sudo xcode-select -s /Library/Developer/CommandLineTools

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


0
投票

对我来说,我必须卸载并重新安装我所有的brew应用程序,如here所记录。

brew list -1 > brew.txt # list out all installed packages
brew list -1 | xargs brew rm --force # remove all installed packages
brew install $(cat brew.txt | tr '\n' ' ') # install all previously installed packages
© www.soinside.com 2019 - 2024. All rights reserved.