我睡了敖 2022-05-09 16:47 采纳率: 100%
浏览 6980
已结题

使用homebrew 的时候失败fatal: not in a git directory Error: Command failed with exit 128: git

使用使用homebrew 的时候失败fatal: not in a git directory Error: Command failed with exit 128: git

 ~  brew install nginx
Warning: No remote 'origin' in /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask, skipping update!
Warning: No remote 'origin' in /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core, skipping update!
Warning: No remote 'origin' in /usr/local/Homebrew/Library/Taps/homebrew/homebrew-services, skipping update!
==> Homebrew has enabled anonymous aggregate formula and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics
No analytics have been recorded yet (nor will be during this `brew` run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations
Running `brew update --preinstall`...
==> Downloading https://mirrors.aliyun.com/homebrew/homebrew-bottles/openssl%401
Already downloaded: /Users/sunkeo/Library/Caches/Homebrew/downloads/fc4281b06e29b8c638b7f3b55da7ab003aef9fcb9f92365ca6f2363d3c07fb40--openssl@1.1-1.1.1o.monterey.bottle.tar.gz
==> Downloading https://mirrors.aliyun.com/homebrew/homebrew-bottles/nginx-1.21.
Already downloaded: /Users/sunkeo/Library/Caches/Homebrew/downloads/5582b7ccc9d76be29176ce182ce68534fb57ac5fa81a8a4f179ee6a0d323b4f8--nginx-1.21.6_1.monterey.bottle.tar.gz
==> Installing dependencies for nginx: openssl@1.1
==> Installing nginx dependency: openssl@1.1
fatal: not in a git directory
Error: Command failed with exit 128: git

怎么解决啊 ,自己重新装了好几次还是这样

img

  • 写回答

8条回答 默认 最新

  • weixin_40983533 2022-05-22 22:22
    关注

    执行brew -v 命令看看是不是有两个提示,你的 homebrew-core和homebrew-cask目录 被git认为不是一个安全的目录,需要手动添加
    git config --global --add safe.directory 你的homebrew-core路径
    git config --global --add safe.directory 你的homebrew-cask路径

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
    1人已打赏
查看更多回答(7条)

报告相同问题?

问题事件

  • 请采纳用户回复 9月5日
  • 系统已结题 8月11日
  • 已采纳回答 8月3日
  • 创建了问题 5月9日

悬赏问题

  • ¥15 使用C#,asp.net读取Excel文件并保存到Oracle数据库
  • ¥15 C# datagridview 单元格显示进度及值
  • ¥15 thinkphp6配合social login单点登录问题
  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 虚心请教几个问题,小生先有礼了
  • ¥30 截图中的mathematics程序转换成matlab