如何解决VSTS中的拉取请求中的合并冲突? [英] How to resolve merge conflict in pull request in VSTS?

查看:475
本文介绍了如何解决VSTS中的拉取请求中的合并冲突?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了拉取请求:



批准按钮什么也不做,完成是禁用的。



如何解决拉请求中的这个错误?
<解决方案

更新



微软刚刚添加了基于浏览器的合并。这可能会让你摆脱泡妞的冲突。



对于更复杂的情况:

您有两个选择来解决冲突,目标分支(创建额外的合并提交),或在目标分支上重新绑定(这会让您的历史记录变得很好并且干净利落)。






在完成PR之前从目标合并到当前分支。



您需要在本地克隆回购,执行从目标分支到分支的合并并推送这些变化直到存储库。 VSTS将检测到更改并更新拉取请求。

  ------- o3 PR 
/
--------- o1-o2 target

因此merge target(o2) PR

  ------- o3-o4 PR 
/ /
--------- o1 ---------- o2 target

然后完成PR

  ------- o3-o4 PR 
/ / \
--------- o1 ---------- o2-- o5目标






重建PR分支以包含最新更改目标



或者,您可以在本地克隆回购,在最新版本的目标分支上重新分配PR分支,解决所有问题,从rebase和force-push更改回PR分支。 VSTS将检测到更改并更新拉取请求。

  ------- o3 PR 
/
--------- o1-o2 target

因此rebase <$ c

$ $ p $ o2 :$ c $ o> > ------- o3 PR
/
--------- o1-o2 target

然后完成 PR (在下面的情况下使用快进合并):

  --------- o1-o2-o3 target 


I've created pull request I got into this:

"Approve" button does nothing and complete is disabled.

How do I resolve this confligt in pull request?

解决方案

Update

Microsoft just added browser based merges. This may get you out of a pickle for small conflicts.

For more complex situations:

You have two options to resolve the conflict, reverse-integrate the changes from the target branch (which creates additional merge commits), or rebase on the target branch (which leaves your history nice and clean).


Merge from target to current branch prior to completing the PR.

You need to clone the repo locally, perform a merge from the target branch to your branch and push those changes up to the repository. VSTS will detect the changes and update the pull request.

            -------o3              PR
           /
---------o1-o2                     target

Thus merge target (o2) to PR:

            -------o3-o4           PR
           /          /
---------o1----------o2            target

Then complete the PR

            -------o3-o4           PR
           /          / \
---------o1----------o2--o5        target


Rebase the PR branch to include the latest changes on target

Alternatively, you can clone the repo locally, rebase the PR branch on the latest version of the target branch, solve all issues from the rebase and force-push the changes back to the PR branch. VSTS will detect the changes and update the pull request.

            -------o3              PR
           /
---------o1-o2                     target

Thus rebase o3 onto o2:

              -------o3            PR
             /
---------o1-o2                     target

Then complete the PR (with Fast-forward merge in the case below):

---------o1-o2-o3                  target

这篇关于如何解决VSTS中的拉取请求中的合并冲突?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆