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 →
- 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
- If consumed, leave it and release
v1.8.1instead. - 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.
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?BeginnerProduction has a bug, but `main` already contains unreleased features. How do you ship a hotfix?Intermediate