git: error: SDK "macosx" cannot be located

git: error: SDK "macosx" cannot be located

刚刚将我的机器更新为 Yosemite。我现在从 Git 收到此错误:

git: error: SDK "macosx" cannot be located

我能够 运行 git status 没有问题,但是 git add 之类的似乎有效,但随后会抛出此错误。命令行工具已安装,我尝试重新安装 Git。

不确定具体是什么,但在升级过程中出现了一些问题。通过键入 sudo rm -r /Library/Developer/CommandLineTools 卸载 CommandLineTools,然后重新安装。我只是输入了一些 git 命令,例如:git status 并让 OS 提示我安装 CommandLineTools。现在一切都很幸福。

我也得到了 git: error: SDK "macosx" cannot be located 引导我到这个页面。

我也收到了类似 "too many files open" 和 "could not fork" 的消息。

关闭 Spotify 问题已解决。我没有重新安装 Git。