问题
When I ran:
brew update
I got a message saying it initialized an empty repository in /usr/local/.git/, then I got this error:
回答1:
cd /usr/localgit status- Discard all the changes (unless you actually want to try to commit to Homebrew - you probably don't)
git statustil it's cleanbrew update
回答2:
Alternatively you could update brew by installing it again. (Think I did this as El Capitan changed something)
Note: this is a heavy handed approach that will remove all applications installed via brew!
Try to install brew a fresh and it will tell how to uninstall.
At original time of writing to uninstall:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
来源:https://stackoverflow.com/questions/6024671/how-do-i-update-homebrew