Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

patch - Git error: previous rebase directory .git/rebase-apply still exists but mbox given

I'm trying to apply a patch, which I took from http://www.winehq.org/pipermail/wine-devel/2014-May/104356.html. I copied it into a text editor, and saved it as my.patch (I needed to fix the email, it had been obfuscated).

I tried to apply it with Git, but I'm getting this error:

sashoalm@sashoalm-VirtualBox:~/Desktop/wine-git$ git am --signoff <my.patch
previous rebase directory /home/sashoalm/Desktop/wine-git/.git/rebase-apply still exists but mbox given.

This cryptic error message gives me no idea what's wrong or what I need to do to make it work. What does this error mean? And how do I fix it?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
git am --abort

worked for me, but git rebase --abort did not.

What happened: I tried to apply a patch but it had been corrupted (likely by Gmail copy pasting in body):

git am bad.patch

And Git said:

Applying: python: fix Linetable case to LineTable in docstrings and comments
fatal: corrupt patch at line 56
Patch failed at 0001 python: fix Linetable case to LineTable in docstrings and comments
The copy of the patch that failed is found in:
   /home/ciro/git/binutils-gdb/src/.git/rebase-apply/patch
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".

Note how git gives out the solution: To restore the original branch and stop patching, run "git am --abort".

Then I obviously ignored the message, and tried a fixed version immediately:

git am good.patch

and got the error.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...