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
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…