There is no reason why I can adapt the stream to your model. You say that you work sequentially SIT โ UAT โ Pre-Prod. Fine. After the development is stable (that is, all the functions to be released are the final processing [ed]), then do a release start and move it to your SIT platform for QA. After the release begins, development can continue in the develop branch. master remains static until release is complete.
Once the QA is executed, the release branch moves to the UAT. The UAT passes and the code goes into standby mode and you execute release finish to merge back into master / develop.
master should always be a reflection of what is currently on a live platform, while develop is a reflection of code in active development. There is a static section in the release branches against which bug fixes are applied (no new functions ever fall into this branch or you do not use git-flow ).
Based on your description, I would be inclined to say that you misunderstood the git-flow model, because from what I see, it fits perfectly into the scenario you described, all you need to take care during SIT โ UAT โ Pre -Prod - release branch, โforgetโ master / develop even at this stage.
Reply to comments
Since I first published this answer, several comments have been made that have raised questions about how the model works in different scenarios.
- Customer requested improvements to existing features
Answer:
NOT NOT (I canโt stress this enough) allow you to add new features / improvements to the release branch. This is a creep area. New features - new work. They must be paid separately and must be treated separately. Regardless of whether your customer is your own company or a third party, the only thing they understand is value. Tell them that if they interrupt the release, it will delay it [indefinitely] or the existing testing will suffer. Relate to the release branch, just like master . It is sacred. Only bug fixes are allowed.
- Branch longevity
If your release branch lasts several months, your release cycle is too long. I worked in those places where the release cycle, on average, every 3 weeks and in other places where we released every couple of days. 3 weeks should be enough time for QA and UAT for the release branch. If you look at a longer cycle, I would say that the company is not flexible and
git -flow is the wrong branching strategy (doubtfully, it works in almost any scenario if it is carefully managed)
You need to challenge the company why the long cycle
(most likely) - you don't understand git-Flow
- Ci
I used git-Flow very successfully with CI. Although these were mainly Jenkins and Bamboo, he also works with Travis CI.
A Git commits-based hook is how any branch works. The best examples that I used are automatically created as soon as the commit (or series of commits) is transferred to the remote control, then the hook starts and calls the CI platform. The CI platform then finds the related job (either using the built-in templates or using a third-party module) to start the build.
My personal setup is to call a local Jenkins instance when:
- I create a branch (creates a new task in the local installation of jenkins aimed at the current branch)
- I commit (starts building a local instance of the current branch)
- Local assembly passages, can automatically click on the remote
- I push the new branch (creates the target assembly in the remote CI
- I push commits (starts a remote CI instance)
- I delete the local branch (deletes the local job)
- Deletes a remote branch (deletes a remote job)
- I raise a merge request (soft merge function / A into development and tests - tests fail, automatically reject deviations)
This requires some configuration, but it is possible with any modern CI platform.
Like everything else, the rules for using git-Flow are just recommendations. There are no hard and fast rules. If you want a long-lasting release branch, then your choice BUT , if you do not pay attention to them, you will get a different code base, which will be hell to unite.
git-Flow, like everything that comes from the * nix toolkit, is just a way to work, and there is a lot of choice with it. A tool and a workflow is nothing more than a wrapper on GIT. How you decide to implement it is entirely up to you.