homebrew安装软件出现git问题
问题
fatal: not in a git directory
Error: Command failed with exit 128: git
问题查找
1. brew -v 查看问题log
suyf@suyfdeMac-mini ~ % brew -v
Homebrew 4.0.18-18-g64259a4
fatal: detected dubious ownership in repository at '/opt/homebrew/Library/Taps/homebrew/homebrew-core'
To add an exception for this directory, call:
git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-core
Homebrew/homebrew-core (no Git repository)
fatal: detected dubious ownership in repository at '/opt/homebrew/Library/Taps/homebrew/homebrew-cask'
To add an exception for this directory, call:
git config --global --add safe.directory /opt/homebrew/Library/Taps/homebrew/homebrew-cask
Homebrew/homebrew-cask (no Git repository)
解决方法
1. 解决方法已经在问题提示里面了。
第一步执行: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
标签:Taps,git,--,directory,add,Error,128,homebrew
From: https://www.cnblogs.com/yongfengnice/p/17677411.html