homebrew安装软件出现git问题fatal: not in a git directory,Error: Command failed with exit 128: git解决方法

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
posted @   yongfengnice  阅读(100)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
点击右上角即可分享
微信分享提示