13 de septiembre de 2011

How to fix Brew Update Error ( mxcl / homebrew, Mac OS X Lion)


Did you, like myself, get something like this while running a brew update?

[matias@MacBookPro]:~ $ sudo brew update
Password:
remote: Counting objects: 588, done.
remote: Compressing objects: 100% (253/253), done.
remote: Total 455 (delta 348), reused 298 (delta 193)
Receiving objects: 100% (455/455), 52.32 KiB, done.
Resolving deltas: 100% (348/348), completed with 124 local objects.
From http://github.com/mxcl/homebrew
 * branch            master     -> FETCH_HEAD
error: The following untracked working tree files would be overwritten by merge:
        .gitignore
        Library/Aliases/0mq
        Library/Aliases/4store
(.... lots of lines ....)
        Library/Formula/android-sdk.rb
        Library/Formula/angband.rb
        Library/Formula/ansifilter.rb
        Library/Formula/antiword.rb
        Library/Formula/antlr.rb
        Library/Formula
Aborting
Error: Failed while executing git pull origin master
The fix is easy. Luckily. Goes like this:
$ sudo chown -R `whoami` /usr/local
$ cd /usr/local
$ git reset --hard origin/master
$ cd

Now you can try again:
[matias@MacBookPro]:local (git: master ?) $ brew update
From http://github.com/mxcl/homebrew
   3dc7fe2..09ebe32  master     -> origin/master
Updated Homebrew from 3dc7fe29 to 09ebe32c.
==> New formulae
aespipe       fuse4x        fuse4x-kext   ntfs-3g       parmetis      s3fs          scotch        sshfs
==> Removed formulae
unix2dos
==> Updated formulae
(.... lots of stuff here ....)

No hay comentarios: