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.
Yes, this is possible.
You'd branch
Main
toQA
, then branchQA
toFeature 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 theQA
branch. It's important to also have devs periodically reverse-integrate fromQA
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) branchMain
to aRelease
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 modifyMain
without it going through (at the very least) theQA
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!