LoginSignup
18

More than 5 years have passed since last update.

fatal:multiple stage entries for merged fileでgit操作ができなくなった時の対処法

Last updated at Posted at 2015-04-21

Gitでコミットしようとして、git statusで確認後、git addをしたら下記のエラーが表示された。

fatal: multiple stage entries for merged file 'filePath/~~~'

その後、git checkout、git commit、git status、git addなどなど、ほとんどのgitコマンドが効かなくなってしまって焦ったので、対処法を記す。

rm .git/index

git add -A
git commit



どうやらindexファイルがおかしなことになっているようなので、indexファイルを削除。
その後、新しく作成されたファイル、削除されたファイルの情報、ファイルの変更を インデックスに追加。

何故このエラーが出るようになってしまったのかが気になるが、これで元通りに作業出来るようになった。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18