我已经将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
谢谢高级!
最好的解决方案是下载并安装它 - 即使你认为它已经安装了:https://git-scm.com/download/mac
我有同样的问题 - 我退出了我的bash会话(关闭了终端)并启动了一个新的并修复了它。
这也发生在我身上,升级到High Sierra和XCode到9.这个序列修复了它。
xcode-select --install
sudo xcode-select -s /Library/Developer/CommandLineTools
在https://davidwalsh.name/fix-git-high-sierra-upgrade找到了这个答案(文章和评论。)
对我来说,我必须卸载并重新安装我所有的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