bash - Git 在 MacOS Catalina : "xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing" 上不工作

标签 bash git macos zsh macos-catalina

<分区>

升级到 MacOS X 10.15 Catalina 后,我无法在我的 shell 中运行任何 git 命令:

The default interactive shell is now zsh.

To update your account to use zsh, please run chsh -s /bin/zsh.

For more details, please visit https://support.apple.com/kb/HT208050.

~ | git

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

我认为我的 shell 有问题,所以我按照说明将默认的 Mac OS shell 改回 bash,使用 GUI 并使用命令行:

chsh -s /bin/bash

我也重启了电脑。但是,我仍然看到相同的消息,即使 echo "$SHELL" 输出 /bin/bash

最佳答案

您需要重新安装命令行工具:

$ xcode-select --install

关于bash - Git 在 MacOS Catalina : "xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing" 上不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58280652/

相关文章:

python - 文件夹+数据库的备份 - Python

windows - Windows 7 中非常基本的 git 批处理

Git fetch 浅克隆没有获取匹配的提交

regex - R 正则表达式中的变音匹配

macos - 在 OS X Lion 中检测和唤醒显示

windows - 在 Windows 中创建的 mac 命令文件中的换行符

linux - 如何编写批量 nslookups 脚本

bash - 如何缩小/混淆 bash 脚本

git 列出远程分支,按提交数量排序

R - 通过 ssh 连接并执行命令