TFS Branching & Merging Strategies

懵懂的女人 提交于 2019-12-10 21:57:23

问题


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.


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/5718669/tfs-branching-merging-strategies

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!