Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use git flow with a staging environment?

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?

like image 578
Eric Avatar asked Apr 15 '13 17:04

Eric


People also ask

Is Git flow still relevant?

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.

What is the best branching strategy in Git?

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.


1 Answers

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.

like image 135
Klas Mellbourn Avatar answered Oct 12 '22 22:10

Klas Mellbourn