Interview Prep/Git & GitHub/Branching Strategies and Releases

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 →

  1. Explain the failure modes: hotfixes made in prod never return, cherry-picks differ per branch, and "what is in prod" depends on merge order.
  2. Propose one trunk, build one immutable artifact per commit, and promote the same artifact through environments.
  3. Store environment differences as config (Helm values, Terraform vars, env-specific files), not branches.
  4. 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".

All Git & GitHub questions Roadmap: Git & GitHub

More on Branching Strategies and Releases