之前安装过xcode,当时装了双系统,后来机子内存不够就把xcode删了,重新装回去后git就没用了,terminal中输入git报错如下:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
顺着提示的目录查找发现缺失命令行工具
可能是删除过一次的原因造成的,网上有很多说法,有时系统更新似乎也会造成这种情况
网上很多教程是Preferences-Download-Command Line Tools云云。但是现在的 xcode界面改了一些,如下
看到Command Line Tools了吗。
或者,上图中的浅色提示告诉你可以直接terminal中输入xcode-select来更新
done~~~