Reputation: 51
My team and I are using GitFlow to versioning our code, but now we need to have a third branch for DEMO to be able to
here is a draft of the versioning flow (I hope it helps):
I can't find a solution with GitFlow, any advice? Should we choose another tool?
Upvotes: 0
Views: 163
Reputation: 42384
This problem sounds like it has arisen as a result of deployment processes, not Git merging strategy.
There is no concept of a demo
branch in GitFlow, though it sounds like you're essentially trying to make use of a release
branch. It's worth noting that there is nothing in GitFlow itself to regulate exactly how you deploy any of your branches, and the choice of whether or not to use GitFlow should be made independent of your server architecture.
What it sounds like you're looking for is to deploy out a release
branch to an independent testing server, then test against that. Once the tests pass, you can deploy the same commit (on the release
branch) out to the production server. This way you don't need to worry about a separate branch specific to testing. Note that master
itself should not be deployed to production; it is merely considered a 'reference' to the last known stable version of the code. You should be merging back to master
straight after a deployment (and tagging the commit) in case you need to revert back to the target version in the future.
This is illustrated in the standard Git Flow shown below:
To take this a step further, there is also a DevOps testing concept of shifting-left, where the develop
branch itself is what is tested against, and considered to be shippable in itself. This simplifies the process even further, and there are pros and cons to choosing such an approach. It may be worth considering after evaluation.
Upvotes: 1