首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Git rebase合并冲突无法继续

Git rebase合并冲突无法继续
EN

Stack Overflow用户
提问于 2013-01-19 10:03:57
回答 4查看 116.7K关注 0票数 166

我正在尝试重新设置“dev”的基址,以赶上“master”分支。

代码语言:javascript
运行
复制
$ 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".

有什么想法吗?

EN

回答 4

Stack Overflow用户

回答已采纳

发布于 2013-01-19 10:31:32

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

这很容易分辨。如果你做了git status,它应该不会显示任何变化。如果是这样,就跳过它。如果不是这样,请发布一份git status,我可以尝试提供进一步的帮助。

票数 272
EN

Stack Overflow用户

发布于 2016-07-16 09:14:18

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

代码语言:javascript
运行
复制
git add <file with conflict>
git commit -m "<some message>"  
git rebase --continue

然而,下面的序列运行时没有任何错误,并继续执行rebase:

代码语言:javascript
运行
复制
git add <file with conflict>
git rebase --continue

带有"All“选项的git add -A可能会造成类似的情况。(请注意,我在git方面非常缺乏经验,因此这个答案可能不正确。)为了安全起见,git rebase --skip似乎在这种情况下也能很好地工作。

票数 18
EN

Stack Overflow用户

发布于 2013-01-19 10:12:37

代码语言:javascript
运行
复制
$ vi src/com....      { verified, no >>> or <<< left, no merge markers } 
$ git rebase --continue 

看起来你忘记了git add你的更改...

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14410421

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档