Mac删除xcode后打git命令出现xcrun报错

xcrun: error

xcrun: error: invalid active developer path (/Applications/Xcode.app/Contents/Developer), missing xcrun at: /Applications/Xcode.app/Contents/Developer/usr/bin/xcrun

报错原因

这是因为git依赖xcode的Com­mand line tools,而在删除xcode的时候也删除了Com­mand line tools,失去了依赖导致git报错。

解决方法

运行以下命令,可以启动安装程序,重新安装命令行工具,以修复依赖。

xcode-select --install

你可能感兴趣的:(macos,git,error)