てきとうなメモ

本の感想とか技術メモとか

brew cask updateしようとするとmergeできないと言われる

$ brew cask update
==> error: The following untracked working tree files would be overwritten by merge:
==>     Library/Formula/cake.rb
==> Please move or remove them before you can merge.
==> Aborting
==> Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
error: The following untracked working tree files would be overwritten by merge:
        Library/Formula/cake.rb
Please move or remove them before you can merge.
Aborting
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master

どうもgitで管理していないformulaがあってmergeできないみたい。リポジトリからfetchしてきてその状態にresetしてあげれば良いらしい。

$ cd /usr/local
$ git fetch
$ git reset --hard origin/master
$ brew cask update
# うまくいく

参考