CPCODELAB
Git & GitHub

Tagging Releases

5 min read

What Are Tags?

A tag is a named pointer to a specific commit, usually used to mark release versions. Unlike branches, tags do not move as new commits are added.

bash
git tag                          # list all tags
git tag v1.0.0                   # lightweight tag on current commit
git tag -a v1.0.0 -m 'Release v1.0.0'  # annotated tag with message
git tag -a v1.0.0 abc1234        # tag a specific commit
git push origin v1.0.0           # push a single tag
git push origin --tags           # push all tags

Annotated tags (created with -a) store the tagger name, email, date, and a message. They are the recommended type for releases. Lightweight tags are just a reference — useful for private bookmarks.

GitHub uses tags to power the Releases feature. When you push an annotated tag, you can draft a release on GitHub with release notes and downloadable assets.

Ready to test yourself?
Practice Git & GitHub— quiz & coding exercises