命令行工具bash(git)无法正常工作 – macOS Sierra最终发布候选版本

我刚刚从OS X 10.11“El Capitan”升级到10.12:“Sierra” ,当我尝试访问terminal内部的git命令时,出现以下错误:

xcrun:error:无效的活动开发者path(/ Library / Developer / CommandLineTools),缺lessxcrun:/ Library / Developer / CommandLineTools / usr / bin / xcrun

请帮助我,如果有人有解决办法。

重新安装Xcode开发人员工具

xcode-select --install 

我通过从Apple Developer下载并安装用于Xcode 8的“命令行工具(macOS sierra)”解决了此问题。

除非安装了Xcode 8.1 beta,否则请务必Command Line Tools (macOS 10.12) for Xcode 8selectCommand Line Tools (macOS 10.12) for Xcode 8而不是8.1版的Command Line Tools (macOS 10.12) for Xcode 8

有同样的问题,并将git的path直接放入configuration文件,它不会再问xcode(如果你不需要使用xcode)。

  1. 下载git, https://git-scm.com/download/mac并安装它。;
  2. 在您的configuration文件添加到path,即导出PATH = $ PATH:/ usr / bin(我的git是在/ usr /斌)。
  3. 打开新的terminal。
Interesting Posts