Should releases use lightweight or annotated tags?
BeginnerScenarioBranching Strategies and Releases
Answer
Situation read → Tags mark release points; the type decides what metadata they carry.
What I'd do →
- Use annotated tags:
git tag -a v1.8.0 -m "Release 1.8.0". - Sign them if policy requires:
git tag -s v1.8.0 -m "...". - Push explicitly:
git push origin v1.8.0(or--follow-tagsfor annotated ones). - Verify with
git show v1.8.0.
Why → Annotated tags are full objects with tagger, date and message, and git describe prefers them. Lightweight tags are just refs.
Interview tip → git push does not send tags by default.
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?IntermediateA release tag was placed on the wrong commit and has been published. What do you do?IntermediateProduction has a bug, but `main` already contains unreleased features. How do you ship a hotfix?Intermediate