Homebrewでupdateをしたらエラーが出た

長いこと更新作業を忘れるとでやすいエラーです.

$ brew update 
error: The following untracked working tree files would be overwritten by merge:
	Library/Formula/cabocha.rb
Please move or remove them before you can merge.
Aborting
Updating 7d2c1da..bfe50e3
Error: Failed while executing git pull  origin refs/heads/master:refs/remotes/origin/master

対策の詳しいことは下記のサイトから
brew update fails · Issue #5128 · Homebrew/legacy-homebrew · GitHub


対処の仕方は次のようにするとOKです.

$ cd /usr/local                                                                                                                               
$ git remote add origin git://github.com/mxcl/homebrew.git                                                                           
fatal: remote origin already exists.
$ git fetch origin
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 3 (delta 2), reused 3 (delta 2)
Unpacking objects: 100% (3/3), done.
From git://github.com/mxcl/homebrew
   4d2d66e..8a968e9  gh-pages   -> origin/gh-pages
$ git reset --hard origin/master                                                                                                     
HEAD is now at bfe50e3 shen: another style issue

うまくアップデートできた!

$ brew update                                                                                                                        
Already up-to-date.