无法在 OS X El Capitan 中开始 Git

Can't start Git in OS X El Capitan

我将我的 os x 从 mavericks 升级到 EL Capitan,当我想在 android studio 中使用 git 时,我收到了这个错误:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

有人有解决办法吗?

查看此解决方案:

将 Mac OS X 更新为“El Capitan”后,我的本地 git 命令不再起作用。使用git命令时,命令行returns:

xcrun:错误:无效的活动开发者路径(/Library/Developer/CommandLineTools),缺少 xcrun:/Library/Developer/CommandLineTools/usr/bin/xcrun

解决此问题的方法是使用以下命令重新安装命令行开发人员工具:

xcode-select --安装

升级到 El-Capitan

后遇到此问题
xcode-select --install 

即使在 'Finding Software' 和下载之后也对我不起作用。我没有安装 Xcode.app(不想安装),所以我通过下载 Command Line Tools from https://developer.apple.com/downloads/(需要 Apple 登录)并手动安装来修复它。

安装后我可以再次运行git命令

xcode-select --install 运行 在你的终端

对我有用