TFS 分支和合并策略
我在 TFS 中有一个团队项目,每天都会提交任务。我想独立完成每个任务,然后在测试后将其合并到主线中。
目前有一个 MAIN 分支和一个 DEV 分支,它是 MAIN 的子分支。更改在 DEV 分支中进行,然后在准备就绪时合并到 MAIN 中。这是通过“挑选”合并来完成的。我到处都读到,挑选合并是不好的,你应该尽可能避免它们。
我在 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.
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.
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.
Any help is appreciated.
If I left out any key information please leave a comment and I will edit my post.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为这个 Codeplex 文档将会有很大帮助:
http://tfsbranchingguideiii.codeplex.com/
下载有几个 PDF 概述了不同的场景和策略,并针对不同的方法提供了出色的问答。
您的场景的关键是将所有更改合并到指定版本(从 Dev 到 Main)。每次将代码签入 Dev 时运行所有测试(开发人员获取最新的 Dev 代码,然后在签入之前运行所有测试)。理想情况下,如果 Dev 签入后 Dev 分支中的构建成功,则合并到 Main 将是一个好主意。经常从 Dev 合并到 Main,并在每次签入后在 Main 中运行所有测试。
因此,即使开发人员单独处理特定的部分,一旦他们检查到开发分支,他们实际上是在说“此代码已准备好集成”。当从 Dev 合并到 Main 时,您不再处理特定的部分 - 您合并整个 enchilada。如果开发人员需要对正在工作的代码进行源代码控制,他们应该使用 TFS 搁置集并等待签入开发,直到“完成”。
I think this Codeplex documentation will be a big help:
http://tfsbranchingguideiii.codeplex.com/
The download has several PDFs that outline different scenarios and strategies and give excellent Q&A on different approaches.
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.
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."
您可能会发现 Timpani Software 的 MergeMagician 工具很有趣。它是一个分支管理和自动合并解决方案,可与 TFS(以及 Subversion)配合使用。您在分支之间创建发布/订阅关系,然后服务器自动进行合并。
MM 可用于实现 Shawn 提到的 TFS 分支指南中讨论的所有模式。
仅供参考,它是一个商业工具。我不知道有任何开源工具可以与 TFS 一起执行类似的操作。
请访问 http://www.timpanisoftware.com 查看。主页上有一个很好的概述视频。
You might find Timpani Software's MergeMagician tool interesting. It is a branch management and automated merging solution that works with TFS (and also Subversion). You create publish/subscribe relationships between branches, and then the server automates the merges.
MM can be used to implement all of that patterns discussed in the TFS Branching Guide that Shawn mentioned.
FYI, it is a commercial tool. I don't know of any open source tools that do anything like this that work with TFS.
Check it out at http://www.timpanisoftware.com. There's a good overview video on the home page.