当前位置:   article > 正文

mac解决brew install报错“fatal: not in a git directory“

mac解决brew install报错“fatal: not in a git directory“

macbook上使用brew安装软件时,可能会遇到问题,报错如下:

  1. fatal: not in a git directory
  2. Error: Command failed with exit 128: git

使用brew -v,仔细看,可以发现有两个fatal(致命错误)提示:

解决方案:

直接复制brew -v 提示的命令 执行命令

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

执行完成后brew -v无报错

再次使用brew install安装软件,完美解决

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/260524
推荐阅读
相关标签
  

闽ICP备14008679号