解决升级MAC之后IDEA中的GIT不能用的问题

问题描述

最近升级了MAC版本,然后重新打开IDEA,并使用GIT时,发现IDEA有一个弹窗报错:Cannot Run Git,查看详细的报错信息:

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

在这里插入图片描述

解决办法

首先在命令行执行:

xcode-select --install

如果还是报错,并且提示报错信息为:xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

那么就查找 xcrun 文件,并复制到:/Library/Developer/CommandLineTools/usr/bin/

命令

locate xcrun   // 查找到该文件在:/usr/bin/xcrun
sudo cp /usr/bin/xcrun /Library/Developer/CommandLineTools/usr/bin/   //复制到目录

执行完商品的操作,如果还报错,那么重启IDEA再看一下

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐