macOS用homebrew时候报 fatal: not in a git directory Error: Command failed with exit 128: git – MasterH杂货铺

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

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注