无法在 MacBook Air 上克隆 git repo

时间:2021-06-27 18:14:36

标签: git git-clone

我最近尝试使用 GitHub 中的 html 克隆 git repo。但是每当我在终端(git clone url)中输入与 git 相关的命令行时,它都会向我显示以下错误。

xcrun: error: unable to load libxcrun (dlopen(/Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib, 0x0005): could not use '/Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib' because it is not a compatible arch).

我尝试查找并尝试了一些建议。我试过 install Xcode -select 但没有用。任何帮助或建议表示赞赏。谢谢

1 个答案:

答案 0 :(得分:1)

您可以尝试删除命令行工具并在之后重新安装它们:

sudo rm -r /Library/Developer/CommandLineTools
xcode-select --install  # or in the GUI

看起来您没有具有所需架构的 libxcrun.dylib。您可以通过将以下输出与命令进行比较来确认这一点:

file /usr/bin/git
file /Applications/Xcode.app/Contents/Developer/usr/lib/libxcrun.dylib