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

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

问题描述

我已经创建了我参与的拉取请求:

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.

并提供改进了 Sprint 150 中不同场景的可视化.

您有两个选项来解决冲突,反向集成来自目标分支的更改(这会创建额外的合并提交),或者基于目标分支(这会使您的历史记录保持整洁).

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

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

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

因此将 target (o2) 合并到 PR:

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

然后完成 PR

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

<小时>

重新设置 PR 分支以包含目标上的最新更改

或者,您可以在本地克隆 repo,将 PR 分支重新设置为目标分支的最新版本,解决所有问题并强制将更改推送回 PR 分支.VSTS 将检测更改并更新拉取请求.


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

因此将 o3 变基到 o2 上:

Thus rebase o3 onto o2:

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

然后完成PR(在下面的例子中使用快进合并):

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

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

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

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