• Mac系统使用homebrew安装组件时报错fatal: not in a git directory Error: Command failed with exit 128: git


    报错

    使用brew安装wget时报错

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

    解决办法

    brew -v 查看会有两个提示,提示用户设置 homebrew-cask 和 homebrew-core 的文件路径为设置为safe.directory, 如下提示:

    Homebrew 3.4.10-54-g987e688
    fatal: unsafe repository ('/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core' is owned by someone else)
    To add an exception for this directory, call:
    
        git config --global --add safe.directory /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
    Homebrew/homebrew-core (no Git repository)
    fatal: unsafe repository ('/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask' is owned by someone else)
    To add an exception for this directory, call:
    
        git config --global --add safe.directory /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask
    Homebrew/homebrew-cask (no Git repository)

    执行命令:

    git config --global --add safe.directory /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
    
    git config --global --add safe.directory /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask

    完成之后再次使用brew命令安装,即可成功

    brew install wget
  • 相关阅读:
    解决sql2008附加不了2005的数据库文件的问题
    方阵
    台阶问题
    螺旋矩阵
    兔子问题
    九乘九乘法口诀
    选猴王
    拿鸡蛋问题
    软工个人作业
    小学四则运算法则训练
  • 原文地址:https://www.cnblogs.com/limaosheng/p/16380055.html
Copyright © 2020-2023  润新知