Git rebase因冲突而失败,但没有冲突

时间:2014-03-18 17:36:28

标签: git rebase tortoisegit merge-conflict-resolution

我尝试对我已提交但未推送的代码执行rebase,因为我听说可能会影响我正在处理的内容的原点发生了一些变化。这是我得到的:

$ git rebase origin/thor-develop
First, rewinding head to replay your work on top of it...
Applying: PH-2127: F193: SYO for Signed in User
Using index info to reconstruct a base tree...
M       js/angular/localization/StoreListCtrl.js
M       templates/default_site/site_embed.group/html_header.html
<stdin>:17: trailing whitespace.

<stdin>:73: trailing whitespace.

<stdin>:77: trailing whitespace.

<stdin>:78: trailing whitespace.
                            $scope.address_dropdown = addressStore.getTop($scope.my_occasion, 3);
<stdin>:79: trailing whitespace.

warning: squelched 16 whitespace errors
warning: 21 lines add whitespace errors.
Falling back to patching base and 3-way merge...
Auto-merging templates/default_site/site_embed.group/html_header.html
Auto-merging js/angular/localization/StoreListCtrl.js
CONFLICT (content): Merge conflict in js/angular/localization/StoreListCtrl.js
Failed to merge in the changes.
Patch failed at 0001 PH-2127: F193: SYO for Signed in User

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".

我们使用Tortoise Git作为前端编辑器,所以我进入了Resolve工具。它通常表示差异,当然可以,而冲突则不然。它显示我在引用的文件(StoreListCtrl.js)中绝对没有冲突。显然存在差异,但根本没有冲突。这是什么意思,我该如何修复它以便我可以完成rebase并最终合并我的代码?

1 个答案:

答案 0 :(得分:7)

解析工具可以自动修复冲突。它曾经发生在我身上(并使我感到困惑)。在这种情况下,您可以直接转到git rebase --continue

完整的清单是:

  • 如果git status显示任何未分阶段的更改:
    • 如果这些文件标有<<< >>>标记冲突:
      • 修复冲突并保存文件
    • 现在使用git add暂存所有未分阶段的更改:这标志着冲突已解决
  • 现在解决并标记任何冲突:使用git rebase --continue