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

Homebrew で「error: The following untracked working tree files would be overwritten by merge: Library/Formula/libarchive.rb」というエラーが発生した場合の対応

More than 5 years have passed since last update.

Homebrew の update 時にエラーが発生。

$ brew update

error: The following untracked working tree files would be overwritten by merge:
Please move or remove them before you can merge.
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master


$ cd /usr/local/Library/Formula
$ git reset --hard FETCH_HEAD
HEAD is now at c784e68 clutter: better homepage

その後、update を実行。

$ brew update

Removing libarchive.rb
Updated Homebrew from c784e68f to c784e68f.
==> Updated Formulae
homebrew/dupes/ab        homebrew/dupes/fetchmail   homebrew/dupes/whois
homebrew/dupes/ant        homebrew/dupes/lapack
homebrew/dupes/diffstat        homebrew/dupes/openssh
==> Deleted Formulae

無事に update できました。


東京在住のWeb Developer
みんなが知ってるあのサービス、実はゆめみが作ってます。スマホアプリ/Webサービスの企画・UX/UI設計、開発運用。Swift, Kotlin, PHP, Vue.js, React.js, Node.js, AWS等エンジニア・クリエイターの会社です。Twitterで情報配信中
Why not register and get more from Qiita?
  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