Lion OS - brew update returns "Runtime Error ..."

I am trying to update my brew when I installed

brew update

I get this error:

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

or

error: The requested URL returned error: 403 while accessing https://github.com/mxcl/homebrew/info/refs
fatal: HTTP request failed
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master

What is the problem with git? How to update brew if this method does not work?

+5
source share
3 answers

This is caused by an old error in code updatethat has long been fixed. However, the nature of the error requires you to do the following:

cd $(brew --repository)
git reset --hard FETCH_HEAD

If brew doctoryou still complain about uncommitted changes, also run the following command:

cd $(brew --repository)    
git clean -fd
+13
source

, " " brew update . , .

+2

The first error you received indicates the following: you have a file Library/Formula/imagemagick.rbthat you changed in your working directory, and these changes were not made. You cannot have uncommitted changes when you do a pull that brew updatedoes implicitly. You must follow the instructions in the error text: before making a brew update, commit all modified files, including imagemagick.rb.

0
source

All Articles