6、Mac下使用brew安装Git时报错Error: Command failed with exit 128: git
现象:Mac下homebrew安装成功,参照Git官网的指导使用brew install git命令来安装Git,一直报错:Error: Command failed with exit 128: git
具体操作:
解决方案:执行如下命令
chunyanzhang@XXX-MacBook-Pro ~ % git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core chunyanzhang@XXX-MacBook-Pro ~ % git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask
结果:使用 git --version命令查看git是否安装成功
chunyanzhang@XXX-MacBook-Pro ~ % git --version git version 2.37.1 (Apple Git-137.1)