I tried to update brew:
sudo brew update
But I got this error:
error: Your local changes to the following files would be overwritten by merge:
Listing a lot of files
Error: Failed while executing git pull http://github.com/mxcl/homebrew.git master
Any idea what is going wrong?
There was a bug in Homebrew that was fixed just a few days ago. To fix the bug you can run git reset --hard FETCH_HEAD
inside your Homebrew installation. Since that won't fix files that are already seen as modified you can also run git checkout Library
to replace your checkout with the latest files. (That wipes all edits so take appropriate measures with any you made.)
The accepted answer is correct but incomplete. If you are getting the error of
error: The following untracked working tree files would be overwritten by merge:
Then go to your terminal and run these commands
cd /usr/local
Then
git reset --hard FETCH_HEAD
Then
git checkout Library
That should get everything in order. Then run
brew update
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With