Homebrew fatal: needed a single revision (MacOs Sierra)

后端 未结 3 1879
天命终不由人
天命终不由人 2020-12-14 15:29

Not sure if this problem is related to upgrading to MacOs Sierra, but since that moment this error occurs when I run \'brew update\'

→ brew update
Checking          


        
相关标签:
3条回答
  • 2020-12-14 16:07

    I had the same problem after upgrading to Sierra.

    In addition to brew --prefix, which displays Homebrew’s install path, there’s also brew --repository, which displays where it’s .git directory is located.

    man brew says that claims that “for standard installs, the prefix and repository are the same directory”. Either the man page is out of date or my install isn’t “standard”, but my prefix is /usr/local and my repository is /usr/local/Homebrew.

    Using the same command but with cd $(brew --repository) worked for me:

    cd $(brew --repository) && git fetch && git reset --hard origin/master
    
    0 讨论(0)
  • 2020-12-14 16:07

    Nothing really worked for me, I had to resort to uninstalling and reinstalling Brew:

    # change to home directory to avoid other errors later
    cd ~
    
    # uninstall brew
    rm -rf /usr/local/Cellar /usr/local/.git && cd ~ && brew cleanup
    
     # reinstall brew
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
    0 讨论(0)
  • 2020-12-14 16:22

    The accepted answer didn't work for me. What worked was uninstalling homebrew and reinstalling it:

    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    brew analytics off
    
    0 讨论(0)
提交回复
热议问题