Help us understand the problem. What is going on with this article?

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

More than 3 years have passed since last 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.

直った!

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away