モノクロタイム

I'm from the future!

homebrewがupdateに失敗するのでどうにかした話

homebrewを使っていて、

brew update

というコマンドはよく叩くのだが、以下の様なエラーが出てupdateができなくなった。

error: Your local changes to the following files would be overwritten by merge:
	Library/Formula/boost.rb
	Library/Formula/protobuf.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

色々調べてみたらリポジトリを一旦リセットすればどうにかなるとのこと。

cd `brew --prefix`
git fetch origin
git reset --hard origin/master

うん、動くようになった。