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

报错如下

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

执行修复代码

Mac 执行 brew install 出现 Error: Command failed with exit 128: git_第1张图片
依次执行下述代码,会比较慢,因为下载的文件较大而且在老外的网上:

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

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