Interview Prep/Git & GitHub/Branching Strategies and Releases

A release tag was placed on the wrong commit and has been published. What do you do?

IntermediateScenarioBranching Strategies and Releases
Answer

Situation read → Moving a published tag silently breaks anyone who fetched it and any artifact built from it.

What I'd do →

  1. If nobody consumed it: delete and recreate:
git tag -d v1.8.0
git push origin :refs/tags/v1.8.0
git tag -a v1.8.0 <right-sha> -m "Release 1.8.0"
git push origin v1.8.0
  1. If consumed, leave it and release v1.8.1 instead.
  2. Tell users; clients must run git fetch --tags --force.

Why → Git never updates an existing tag on fetch without force, so users silently keep the wrong one.

Interview tip → "Tags are immutable by policy" is the answer most teams adopt; enforce it with a tag ruleset.

All Git & GitHub questions Roadmap: Git & GitHub

More on Branching Strategies and Releases