Git错误:以前的rebase目录.git/rebase-apply仍然存在,但是给出了mbox

sas*_*alm 58 git patch

我正在尝试应用补丁,我从http://www.winehq.org/pipermail/wine-devel/2014-May/104356.html获取.我把它复制到一个文本编辑器中,并保存为my.patch(我需要修复电子邮件,它已被混淆).

我试着用Git应用它,但是我收到了这个错误:

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.
Run Code Online (Sandbox Code Playgroud)

这个神秘的错误消息让我不知道出了什么问题或我需要做些什么来使它工作.这个错误是什么意思?我该如何解决?

Cir*_*四事件 53

git am --abort
Run Code Online (Sandbox Code Playgroud)

为我工作,但git rebase --abort没有.

发生了什么:我尝试应用补丁但它已被破坏(可能是Gmail拷贝粘贴在体内):

git am bad.patch
Run Code Online (Sandbox Code Playgroud)

而Git说:

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".
Run Code Online (Sandbox Code Playgroud)

注意git如何给出解决方案: To restore the original branch and stop patching, run "git am --abort".

然后我显然忽略了这条消息,并立即尝试了一个固定的版本:

git am good.patch
Run Code Online (Sandbox Code Playgroud)

并得到了错误.


sas*_*alm 37

好的,事实证明我需要删除目录.git/rebase-apply.它之后工作(或至少给我不同的错误,说电子邮件再次错误).我仍然不知道错误实际意味着什么或为什么会出现错误.

编辑:正如下面的评论所示,git am --abort可能是解决问题的更好方法,但我还没有测试过.

  • +1表示可以修复我的问题的`git rebase --abort`.如果问题是由错误的合并引起的,那么`git am --abort`可能就是这样. (11认同)
  • 在我的情况下的问题是它说'git rebase --abort`不起作用bc git am已经运行了.我认为要么你需要像你建议的那样摆脱目标,要么运行`git am --abort`. (5认同)
  • 该错误意味着在某个时刻您运行了一个“git rebase”,该操作由于某些冲突而停止,并等待您完成一些操作并执行“git rebase --continue”来完成。解决这种情况的正确方法是 a) 修复 `git rebase` 有问题的问题,然后 `git rebase --continue`,或者 b) `git rebase --abort`。您的存储库现在可能会或可能不会混淆。阅读“git help rebase”以获取更多信息。 (2认同)
  • 其他命令可能会发生这种情况.所以不要盲目地复制命令,而是运行`git status`,前几行会告诉你是否有正在进行的rebase/am/etc以及你有什么选择. (2认同)