TFS:使用来自main的更改更新分支 [英] TFS: Updating branch with changes from main

查看:142
本文介绍了TFS:使用来自main的更改更新分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我们有主开发线,我创建了一个分支,而开发人员b创建了一个分支。我们俩都做一些工作。开发人员b完成工作,并重新合并到主要开发人员行中。我知道他的更改会影响我,而不是以后再处理冲突,我想用我的主开发行中的更改来更新我的分支,以便在合并之前在我的分支中进行处理

So, we have our main dev line, I create a branch, and developer b creates a branch. We both do some work. developer b finishes his work, merges back into the main dev line. I know his changes will affect me, and rather than deal with the conflicts later, I would like to update my branch, with the changes that are now in the main dev line, so I can deal with them in my branch, prior to merging back into main.

我该怎么做?

推荐答案

在Visual Studio中,打开Source Control Explorer:

From Visual Studio, open Source Control Explorer:


  • 视图|团队资源管理器

  • 从团队资源管理器中选择您的团队项目,将其展开,然后双击源代码控制
  • >
  • 在Source Control Explorer的左侧窗格中,选择您的 Team Project

  • 在右侧窗格中,找到您的主线分支,右键单击并选择合并...

  • Target分支下拉列表中,选择您的dev分支

  • 如果要在主线中进行所有更改的子集:

    • 选择选定更改集单选按钮,单击下一步

    • 选择代表从其他开发人员分支到主分支的合并的变更集,然后单击下一步

    • View | Team Explorer
    • Select your Team Project from Team Explorer, expand it, and double click Source Control
    • In the left-hand pane of Source Control Explorer, select your Team Project.
    • In the right-hand pane, find your mainline branch, right-click and select Merge...
    • In the Target branch drop-down, select your dev branch.
    • If you want a subset of all the changes in the mainline:
      • Choose the Selected changesets radio button, click Next.
      • Select the changesets that represent the merge from your other dev's branch into main, click Next.

      • 下一步是选择版本类型。默认的最新版本显然是简单明了的:您将使用所有更改,因为您的分支是从主线创建到分支的。其他选择很简单,但是这里提供的每个选项的教程说明都将占用相当多的空间。

      • 遍历向导的其余步骤。

      • The next step has you pick a Version type. The default, Latest Version is obviously straightforward and self-explanatory: you would be brining all changes since your branch was created from the mainline down into your branch. The other choices are straightforward, but a tutorial explanation of each option available here would take a fair amount of space.
      • Walk through the remaining steps of the wizard.

      • 视图|其他窗口|待更改

      • 确保已选中与该合并相关的所有文件,添加描述合并的注释,然后单击签入
      • >
      • View | Other WIndows | Pending Changes
      • Make sure all the files related to this merge are checked, add comments describing the merge, and click Check In.

      我建议保留合并(以及任何必要的合并冲突解决方案,构建中断,测试中断)作为自己的变更集。也就是说,请勿将其他功能与合并混合使用。粒状变更集使查看源代码管理历史记录和识别单个感兴趣的变更变得更加容易。将合并工作保持在自己的变更集中有助于实现该目标。

      I recommend keeping merges (and any necessary merge conflict resolution, build breaks, test breaks) as their own changeset. That is, do not mix other feature work with merges. Granular changesets make it much easier to review source control history, and to identify a single change of interest. Keeping merge work in its own changeset helps work toward that goal.

      也有用于合并的命令行,请运行 tf merge /?,从Visual Studio命令提示符中获得。

      There is command-line for merging as well, run tf merge /? from a Visual Studio Command Prompt.

      祝您好运,玩得开心!

      这篇关于TFS:使用来自main的更改更新分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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