macOS用homebrew时候报 fatal: not in a git directory Error: Command failed with exit 128: git – MasterH's Grocery Store

macOS用homebrew时候报 fatal: not in a git directory Error: Command failed with exit 128: git

解决办法
用 brew doctor查看 homebrew-core 和 homebrew-cask 路径

brew doctor

file

这两个目录被git认为不是一个安全的目录,需要手动添加

git config --global --add safe.directory 你的homebrew-core路径
git config --global --add safe.directory 你的homebrew-cask路径

file

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *