mac os brew “not in a git directory“报错

在尝试使用brew安装telnet时遇到git相关错误。通过运行brewdoctor,发现Homebrew的git源不标准,以及homebrew-cask和homebrew-core未正确tap。按照警告提示,删除并重新tap相关仓库后,成功安装telnet。
摘要由CSDN通过智能技术生成

brew install telnet报错如下

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

解决过程:

x@y ~ % brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Suspicious https://github.com/Homebrew/brew git origin remote found.
The current git origin is:
  https://mirrors.ustc.edu.cn/brew.git

With a non-standard origin, Homebrew won't update properly.
You can solve this by setting the origin remote:
  git -C "/opt/homebrew" remote set-url origin https://github.com/Homebrew/brew

Warning: Homebrew/homebrew-cask was not tapped properly! Run:
  rm -rf "/opt/homebrew/Library/Taps/homebrew/homebrew-cask"
  brew tap homebrew/cask

Warning: Homebrew/homebrew-core was not tapped properly! Run:
  rm -rf "/opt/homebrew/Library/Taps/homebrew/homebrew-core"
  brew tap homebrew/core
hongling.ruan@HRUAN1ML1 ~ % brew install --debug ets
Warning: No available formula with the name "ets". Did you mean etsh, etl, ots or gts?

根据warning运行命令重新brew install成功

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值