Mac 执行 brew install 出现 Error: Command failed with exit 128: git

报错如下

fatal: not in a git directory
Error: Command failed with exit 128: git

执行修复代码

在这里插入图片描述
依次执行下述代码,会比较慢,因为下载的文件较大而且在老外的网上:

git -C "/opt/homebrew" remote set-url origin https://github.com/Homebrew/brew
rm -rf "/opt/homebrew/Library/Taps/homebrew/homebrew-cask"
brew tap homebrew/cask
rm -rf "/opt/homebrew/Library/Taps/homebrew/homebrew-core"
brew tap homebrew/core

猜你喜欢

转载自blog.csdn.net/Fine_Cui/article/details/126480494
今日推荐