Interview Prep/Git & GitHub/Branching Strategies and Releases

QA signs off on a build, and production must run exactly that code. How does Git support this?

IntermediateScenarioBranching Strategies and Releases
Answer

Situation read → The risk is rebuilding from a branch and getting different results.

What I'd do →

  1. Build once per commit; name artifacts by commit SHA (for example the image tag app:3f9a1c2).
  2. Deploy that exact tag to QA, then production; never rebuild.
  3. Tag the release on the same SHA: git tag -a v2.5.0 3f9a1c2.
  4. Record the SHA in deployment metadata so git log explains what runs where.

Why → Branch names move, SHAs do not.

Interview tip → Pair this with pinned dependencies and lockfiles for true reproducibility.

All Git & GitHub questions Roadmap: Git & GitHub

More on Branching Strategies and Releases