2

My goal is to have a structure like this:

Project X
-- Main
-- QA
-- Dev
  -- Feature X

Ideally, when working on a new feature, I would like to branch off the "Main" trunk and create a new "Dev/Feature X" branch. Once I have the feature ready for testing, I would like to move the "Feature X" to "QA" with the merging tool. Then go from the "QA" branch once it is done and tested. Once that is true, I would like to merge from "QA" into "Main".

Is this possible? Id like to do this without doing a baseless merge. I am unsure how to structure the branches to achieve this solution.

Travyguy9
  • 4,774
  • 8
  • 43
  • 63
  • See this for possible info: http://stackoverflow.com/questions/5395867/how-can-i-branch-my-code-in-a-way-that-makes-testing-possible-without-contaminat?rq=1 – Preet Sangha Dec 02 '13 at 23:13

1 Answers1

3

Yes, this is possible.

You'd branch Main to QA, then branch QA to Feature X, Feature Y, etc.

Then, devs code in the Feature branches, and when the feature is complete, merge the code from the feature branch to the QA branch. It's important to also have devs periodically reverse-integrate from QA back up to their feature branches, to make sure that all of the latest changes are present and working in their dev branch.

When the release is done and tested in the QA branch, you merge it back to Main, and then (if you desire) branch Main to a Release branch.

In this scenario, Main should always represent absolutely vetted, shippable code -- either the code you just shipped, or the code you're about to ship. No one should ever modify Main without it going through (at the very least) the QA branch.

Basically, the part you're missing is that your code should always travel through the QA branch. I usually call this an "Integration" branch instead of "QA", but the purpose is the same.

The ALM Rangers have an awesome branching/merging guide -- I strongly recommend reading it!

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
  • Sure. I get that and I do know that will work. I also think we will go that route but what I asked was if it would be possible to do all that except have the Dev's branch from Main to Feature X (not QA to Feature X). Im guessing that won't work since QA wont be the "parent" to the Feature so TFS won't let them later merge Feature X into QA. Is that correct? – Travyguy9 Dec 03 '13 at 15:16
  • That's correct -- it would be a baseless merge. The recommended approach is the one I talked about. – Daniel Mann Dec 03 '13 at 15:22