How do you create and manage tags in Git, and when would you use them?

Git tags are references that mark a specific commit as significant, most commonly used to label release versions so they can be found and checked out easily later.

Key Points

Example

After merging the final commit for a release, the team runs git tag -a v2.1.0 -m "Release 2.1.0" and pushes it, so anyone can later run git checkout v2.1.0 to get exactly that release.

git tag -a v2.1.0 -m "Release 2.1.0"
git push origin v2.1.0

Interview Tip

A concise interview answer is

I create annotated tags with git tag -a to mark release points, since they store metadata like the author and message, and push them explicitly with git push --tags. Tags give a stable, unmoving reference to a specific release, unlike branches which keep moving forward.

Last updated: 16 July 2026

Previous question: Describe a situation where you had to resolve a complicated merge conflict involving multiple files.

Next question: A teammate pushes a commit that breaks the build. What steps would you take?

More Git - Level II interview questions

All Git - Level II questions