We are using git-flow to handle hotfixes & features, with a develop branch & the master branch (for production).
What is the easiest way to add a staging branch to the mix so that we can validate work that is on its way to production from develop while still keeping the helpfulness of git-flow?
Gitflow has fallen in popularity in favor of trunk-based workflows, which are now considered best practices for modern continuous software development and DevOps practices. Gitflow also can be challenging to use with CI/CD.
Build your strategy from these three concepts: Use feature branches for all new features and bug fixes. Merge feature branches into the main branch using pull requests. Keep a high quality, up-to-date main branch.
I would say that staging should be based on a git flow release branch. After a git flow release start
and git flow release publish
you can start QA work on that branch, including deploying it to a staging area. When the QA work in the staging area has proven the code ready for production deploy in production and do git flow release finish
.
If you are using TeamCity, you can easily set up the server to detect new remote release branches and automatically set up builds for them, see here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With