brew updateが失敗したが直ったメモ


正しいやり方とか知らないけど直った超適当解決メモ。。

$ brew update
error: Your local changes to the following files would be overwritten by merge:
        file-formula.rb
        lsof.rb
        openssh.rb
        whois.rb
Please, commit your changes or stash them before you can merge.
Aborting
Error: Failed to update tap: homebrew/dupes
Already up-to-date.

みたいなエラーが出た。
↓この場所に移動してみたら、こんなんなっててgit pullが出来なくなってたので。

$ cd /usr/local/Library/Taps/homebrew/homebrew-dupes
$ git status
On branch master
Your branch is behind 'origin/master' by 53 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        modified:   diffutils.rb
        modified:   fetchmail.rb
        modified:   file-formula.rb
        modified:   gdb.rb
        modified:   grep.rb
        modified:   groff.rb
        modified:   libpcap.rb
        modified:   lsof.rb
        modified:   nano.rb
        modified:   ncurses.rb
        modified:   openldap.rb
        modified:   openssh.rb
        modified:   rsync.rb
        modified:   tcl-tk.rb
        modified:   tcpdump.rb
        modified:   whois.rb

↓バッサリ綺麗にする。

$ cd /usr/local/Library/Taps/homebrew/homebrew-dupes
$ git reset --hard
$ git pull

で、再度実行。

$ brew update
:
Already up-to-date.

直った!