2023-08-11

brew update无法正常使用

解决方案

运行如下命令添加 Git 信任目录homebrew-core、homebrew-cask、homebrew-services

git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core

git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask

git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-services


同样如果要取消之前添加的 Git 信任目录运行如下命令即可

git config --global --unsetsafe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core

git config --global --unsetsafe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask

git config --global --unsetsafe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-services


运行如下命令可查看 Git 全局配置

git config --global --list

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容