Git rebase合并冲突无法继续

awm*_*awm 114 git git-rebase

我正试图改变'dev'以赶上'master'分支.

$ git checkout dev 
$ git rebase master 
First, rewinding head to replay your work on top of it...
Applying: Corrected compilation problems that came from conversion from SVN.
Using index info to reconstruct a base tree...
M       src/com/....
<stdin>:125: trailing whitespace.
/**
<stdin>:126: trailing whitespace.
 *
<stdin>:127: trailing whitespace.
 */
<stdin>:128: trailing whitespace.
package com....
<stdin>:129: trailing whitespace.

warning: squelched 117 whitespace errors
warning: 122 lines add whitespace errors.
Falling back to patching base and 3-way merge...
Auto-merging src/com/....
CONFLICT (content): Merge conflict in src/com/...
Failed to merge in the changes.
Patch failed at 0001 Corrected compilation problems that came from conversion from SVN.

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To check out the original branch and stop rebasing run "git rebase --abort".

$ vi src/com/.....   { fixed the merge issue on one file } 
$ git add -A . 
$ git rebase --continue 
src/com/....: needs merge
You must edit all merge conflicts and then
mark them as resolved using git add
$ vi src/com....      { verified, no >>> or <<< left, no merge markers } 
$ git rebase --continue 
Applying: Corrected compilation problems that came from conversion from SVN.
No changes - did you forget to use 'git add'?
If there is nothing left to stage, chances are that something else
already introduced the same changes; you might want to skip this patch.

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To check out the original branch and stop rebasing run "git rebase --abort".
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

Chr*_*ola 191

有几种情况我见过rebase卡住了.一种是如果更改变为空(提交已经在先前在rebase中进行了更改),在这种情况下您可能必须使用git rebase --skip.

这很容易辨别.如果你这样做git status,应该没有变化.如果是这样,请跳过它.如果不是这样,请发一份副本,git status我可以尝试进一步提供帮助.

  • git status返回:“正在进行基准;在&lt;commitnumber&gt;上,您当前正在在'&lt;commitnumber&gt;'上对分支'&lt;branchname&gt;'进行基准调整。(已解决所有冲突:运行” git rebase --continue“)”。git rebase --continue不返回任何变化,而git rebase --skip可以,但是在我的情况下,我一次又一次地遇到这种情况。是对的还是有什么问题? (2认同)

小智 14

我遇到这个问题的有一次是在做了git commit之后git add.因此,以下序列将产生您提到的rebase错误:

git add <file with conflict>
git commit -m "<some message>"
git rebase --continue

虽然,下面的序列运行没有任何错误,并继续rebase:
git add <file with conflict>
git rebase --continue

有可能git add -A使用"全部"选项创建类似的情况.(请注意,我对git非常缺乏经验,所以这个答案可能不正确.)为了安全起见,git rebase --skip这种情况似乎也很好用.


Von*_*onC 6

注意:Git 2.0.2(2014年7月)修复了一个案例,其中一个git rebase --skip将被卡住并且无法继续使用当前的rebase.
提交95104c7布赖恩·米 卡尔森(bk2204)

rebase--merge:修复--skip连续两个冲突

如果git rebase --merge遇到冲突,--skip如果下一次提交也发生冲突将无法工作.
msgnum文件永远不会使用新的修补程序编号进行更新,因此实际上不会跳过任何修补程序,从而导致不可避免的循环.

更新msgnum文件的值作为call_merge中的第一件事.
这也避免了Already applied跳过提交时的" "消息.
调用call_merge的其他上下文没有明显的变化,因为msgnum文件的值在这些情况下保持不变.


Pet*_*vel 6

在经历了很多冲突(长git status)的变基之后,我无法弄清楚我应该上演什么。我使用与 PhpStorm 集成的 Git,它没有显示任何未暂存的文件。

git add .没有解决,但此评论建议致电 git diff-files --ignore-submodules。这显示了我必须专门 git add 的三个文件,这就成功了。