4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

🌱【Git】「It looks like 'git am' is in progress」エラーの解消法

Last updated at Posted at 2020-04-15

環境

Windows 10
SourceTree 3.3.4

やりたいこと

patchファイルを「完全なコミットとして取り込む」で取り込もうとしたらエラーが出てしまった

初回

git
-c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks am -p 1 --3way
C:\Users\hoge\Documents\files\test\patch\20200415\syusei.patch
Applying: 【修正対応】テスト
Using index info to reconstruct a base tree...
M   hoge/app/Controller/foo/HogeFugaController.php
Falling back to patching base and 3-way merge...
Auto-merging hoge/app/Controller/foo/HogeFugaController.php
CONFLICT (content): Merge conflict in hoge/app/Controller/foo/HogeFugaController.php




Patch failed at 0001 【修正対応】テスト
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".



error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch' to see the failed patch

エラー終了しました。エラーの内容は上記をご覧ください。

2回目

git
-c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks am -p 1 --3way
C:\Users\hoge\Documents\files\test\patch\20200415\syusei.patch
fatal: previous rebase directory .git/rebase-apply still exists but mbox given.
エラー終了しました。エラーの内容は上記をご覧ください。

再度SourceTreeいじってたらリベース状態のままになっていて、
下記エラーが表示されてできない作業があったので修正する

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks rebase --abort
fatal: It looks like 'git am' is in progress. Cannot rebase.
エラー終了しました。エラーの内容は上記をご覧ください。

やったこと

Git Bashにて下記コマンドを実行しリベースやり残し状態を解除

GitBash.sh
rm -rf .git/rebase-apply

もしくは.git内にあるrebase-applyを直接削除する

rebase.png

結果

リベース状態が解除される

GitBash.sh
eltociear@ELTOCIEAR-PC MINGW64 ~/Documents/develop (test/test_develop|AM 3/27)
$

GitBash.sh
eltociear@ELTOCIEAR-PC MINGW64 ~/Documents/develop (test/test_develop)
$
4
3
0

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
4
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?