安装软件提示:
fatal: not in a git directory
Error: Command failed with exit 128: git
➜ ~ brew update
Warning: No remote 'origin' in /opt/homebrew/Library/Taps/homebrew/homebrew-cask, skipping update!
Warning: No remote 'origin' in /opt/homebrew/Library/Taps/homebrew/homebrew-core, skipping update!
Warning: No remote 'origin' in /opt/homebrew/Library/Taps/homebrew/homebrew-services, skipping update!
Xcode在2022.05.21更新之后修改了git,,这三个目录被git认为是不安全的路径,需要手动添加
git config --global --add safe.directory 你的homebrew-core路径
git config --global --add safe.directory 你的homebrew-cask路径
git config --global --add safe.directory 你的homebrew-services路径
在2022.05.21更新Xcode后,git对于某些目录(如homebrew-core、homebrew-cask和homebrew-services)认为是不安全路径,导致安装软件时出现错误。解决方法是通过git config命令手动添加这些目录到全局安全路径列表中。

1173

被折叠的 条评论
为什么被折叠?



