How to Create and Use Tags in Git (git tag)

git tag marks a specific commit with a fixed, memorable name, most commonly used to mark release versions.

Published September 28, 2026

git tag marks a specific commit with a permanent name, usually a release such as v1.0.0. Unlike branches, tags do not move.

How it works

Lightweight tags are just names; annotated tags (-a) store the tagger, date and message and are recommended for releases.

Tags are not pushed by default; push them explicitly.

Try it

git tag -a v1.0.0 -m "First release"
git push origin v1.0.0
git tag
v1.0.0

Practical examples

Annotated tag

git tag -a v1.2.0 -m "Release 1.2.0"

Tag an older commit

git tag -a v1.0.1 a1b2c3d -m "Hotfix"

Push all tags

git push --tags

Delete

git tag -d v1.0.0
git push origin --delete v1.0.0

Common mistakes

  • Forgetting to push tags.
  • Reusing or moving release tags.
  • Using lightweight tags for releases.

Key takeaways

  • Tags mark releases.
  • Annotated tags carry metadata.
  • Push them explicitly.

FAQ

Tag vs branch?

A branch moves; a tag stays on one commit.

How do I check out a tag?

git switch --detach v1.0.0.

More Git articles