TFS分支机构合并策略 [英] TFS Branching & Merging Strategies

查看:195
本文介绍了TFS分支机构合并策略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在TFS中有一个团队项目,每天都要提交任务.我想独立完成每个任务,然后在测试后将其合并到主行中.

I have a Team Project in TFS where tasks are submitted daily. I would like to work on each task independently and then merge it into the main line after testing.

当前有一个MAIN分支和一个DEV分支,它是MAIN的子级.更改在DEV分支中处理,然后在准备好时合并到MAIN中.这是通过樱桃选择"合并完成的.我到处都读到樱桃选择合并不好,您应该尽可能避免使用它们.

Currently there is a MAIN branch and a DEV branch which is a child of MAIN. Changes are worked on in the DEV branch and then merged into MAIN when they are ready. This is done via a "cherry-pick" merge. I've been reading everywhere that cherry-pick merges are bad and you should avoid them whenever possible.

我很难在TFS中进行分支和合并,我想知道是否有人对如何在TFS中实现此目标有任何建议,而不必进行樱桃选择合并.

I am having trouble wrapping my head around branching and merging in TFS and was wondering if anyone had any suggestions on how to achieve this goal in TFS without having to do cherry pick merges.

感谢您的帮助.

如果我遗漏了任何关键信息,请发表评论,我将编辑我的帖子.

If I left out any key information please leave a comment and I will edit my post.

推荐答案

我认为此Codeplex文档将有很大帮助:

I think this Codeplex documentation will be a big help:

http://tfsbranchingguideiii.codeplex.com/

下载的文件中包含多个PDF,概述了不同的方案和策略,并对不同的方法给出了很好的问答.

The download has several PDFs that outline different scenarios and strategies and give excellent Q&A on different approaches.

您的方案的关键是将所有更改合并到指定版本(从Dev到Main).每次将代码签入Dev时运行所有测试(开发人员获取最新的Dev代码,然后在签入之前运行所有测试).理想情况下,如果在Dev签入后在Dev分支中的构建成功,则合并到Main中将是一个好主意.经常从Dev合并到Main,并在每次签入后在Main中运行所有测试.

The key for your scenario would be to merge all changes up to a specified version from Dev to Main. Run all tests each time code is checked into Dev (and developers get the latest Dev code, then run all tests before checking in). Ideally, if the build in the Dev branch is successful after Dev checkin, merging into Main would be a good idea. Merge frequently from Dev to Main, and run all the tests in Main after each checkin.

因此,即使开发人员单独处理特定的部分,一旦他们进入Dev分支,他们实际上就是在说此代码已准备好进行集成".当从Dev合并到Main时,您不再处理特​​定的部分-您合并了整个辣酱玉米饼馅.如果开发人员需要在制品代码的源代码控制,则应使用TFS架子集并等待检入Dev,直到完成".

So even though developers work individually on specific pieces, once they check into the Dev branch they are essentially saying "this code is ready to integrate." And when merging from Dev to Main, you no longer deal with specific pieces--you merge the whole enchilada. If Developers need source control for work-in-process code, they should use TFS shelvesets and wait to check into Dev until they are "done."

这篇关于TFS分支机构合并策略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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