A team uses long-lived `dev`, `qa` and `prod` branches with merges between them. What goes wrong?
AdvancedScenarioBranching Strategies and Releases
Answer
Situation read → Environment branches mix "what code" with "where deployed", and they drift.
What I'd do →
- Explain the failure modes: hotfixes made in
prodnever return, cherry-picks differ per branch, and "what is in prod" depends on merge order. - Propose one trunk, build one immutable artifact per commit, and promote the same artifact through environments.
- Store environment differences as config (Helm values, Terraform vars, env-specific files), not branches.
- Migrate gradually: freeze environment branches, merge all into
main, switch pipelines to promote by SHA.
Why → What you test in QA should be byte-for-byte what reaches prod.
Interview tip → Say "promote artifacts, not branches".
More on Branching Strategies and Releases
An eight-person team deploys several times a day. Which branching strategy do you recommend?IntermediateWhen would you choose GitFlow over trunk-based development?IntermediateIn trunk-based development, a feature will take three weeks. How do you merge it daily without exposing it?IntermediateYou are cutting a release. How do you manage the release branch and late fixes?IntermediateShould releases use lightweight or annotated tags?BeginnerA release tag was placed on the wrong commit and has been published. What do you do?Intermediate