mac上通过xcode安装git

之前安装过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~~~

发布了34 篇原创文章 · 获赞 54 · 访问量 9万+

猜你喜欢

转载自blog.csdn.net/Mart1nn/article/details/87032095
今日推荐