Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while trying to update brew package manager

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?

like image 356
Chiron Avatar asked Aug 03 '11 22:08

Chiron


2 Answers

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.)

like image 174
Turadg Avatar answered Oct 06 '22 12:10

Turadg


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 
like image 22
JGallardo Avatar answered Oct 06 '22 12:10

JGallardo