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!