All jobs / DevOps / SRE / cloud / Git
DevOps / SRE / cloud interview question · 1–3 years
What is a git tag for in a release pipeline?
The strongest answer
An immutable name — an annotated semver tag such as v2.3.1 — on the exact commit the release was built from; the pipeline builds from the tag and stamps the artifact with it; tags never move
Why it works
Exactly — the tag is the contract between “what we shipped” and “what is in git”. Immutable and annotated, or it is not a release.
What a good answer covers
- Tag equals shipped commit.
- Annotated, semver, immutable.
- Build and stamp from the tag.
- Never move a tag.
Answers that fall short
- Close, but not the strongest: A bookmark so we can find old versions later if we need to
True but shallow; the point is that builds, rollbacks and incident forensics all key off the tag. - Weak: A branch you cannot commit to; we use them for long-term support
A tag points at one commit; a branch moves. Confusing them is how support branches get created by accident. - Red flag: After a hotfix we move v2.3.1 to the fixed commit so the version name stays the same
Moving a tag means two different builds carried the same name; nobody can trust what v2.3.1 means afterwards.
Who gets asked this
More Git questions
- Production runs v2.3.0. main has two weeks of unreleased work. A critical bug must ship today. What is your…
- p95 latency doubled somewhere in the 60 commits between last week’s release and today’s. Nothing in the diffs…
- What do you standardise, and where do you allow a difference?
- When do you rebase, and when must you never?
- A commit on main broke the build; three teammates have already pulled it. How do you undo it?