I understand this is opinion based and may not be the correct answer for everyone/situation. (Thank you to @adam for the mention of git-flow.)
The environments:
Staging is intended to be a stable release/environment that can be deployed to master at any point in time. Dev is the QA and dev environment before staging.
Git branches:
- master (production)
- staging
- dev
- feature/[name] bugfix/[name] etc. (follows git-flow pattern)
The development process/flow:
A developer is assigned a ticket. The developer checks out a new feature/bugfix branch from staging
branch. The developer does hiser work on the feature/bugfix branch and MR/PR's into dev
branch so it can be QA'd in the dev environment. Once the ticket passes QA, the developer opens an MR/PR with feature/bugfix
-> staging
. After the feature/bugfix
is merged into staging
it can be discarded.
Housekeeping needs to be kept up to date on the branches, regularly - most importantly, dev
needs to rebase on staging
often to keep the QA environment healthy and up to date.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…