So I'm trying to update my home brew version but I get an error. Here is a copy pasted part from the console:

$ brew update
error: Your local changes to the following files would be overwritten by merge:
Please, commit your changes or stash them before you can merge.
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master

Now, reading this makes it seem like I have change the v8 formula file, but I have not. Going to the file at /usr/local/Library/Formula/v8.rb and looking at it shows that it was last edited in 13 November, 2014. But I could update yesterday.

And I'm not sure how to "stash" my changes. Any idea what do to? Force overwrite it possibly?


Im not sure what the error was but this fixed it:

cd `brew --prefix`
git reset --hard FETCH_HEAD

Then I could brew update just fine.


This may help:

git --git-dir $(brew --repository)/.git reset origin/master --hard
git --git-dir $(brew --repository)/.git clean -fd

See: Common Issues with Homebrew

For further Git issues, check:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.