最近升级MAC OS 10.11以后,git莫名其妙的不能用了。当Git clone 一个开源项目时,提示如下错误:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
重新安装一下xcode-select即可,命令如下:
xcode-select –install
之后git又可以正常工作了。
(或者不重装,“sudo xcode-select -switch /”一下也可)。