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
MaintoQA, then branchQAtoFeature X,Feature Y, etc.Then, devs code in the
Featurebranches, and when the feature is complete, merge the code from the feature branch to theQAbranch. It's important to also have devs periodically reverse-integrate fromQAback 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) branchMainto aReleasebranch.In this scenario,
Mainshould always represent absolutely vetted, shippable code -- either the code you just shipped, or the code you're about to ship. No one should ever modifyMainwithout it going through (at the very least) theQAbranch.Basically, the part you're missing is that your code should always travel through the
QAbranch. 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!