git tag

A name fixed permanently to one commit, usually to mark a release such as v1.0, and the command that creates and lists them.

In more detail

Unlike a branch, a tag does not move when you commit. git tag v1.0 makes a lightweight tag, just a name, while git tag -a v1.0 -m 'Release version one' makes an annotated tag with its own author, date and message. Tags are not pushed automatically: use git push origin v1.0, or --tags for all of them.

Examples

In the course lab every deployment is an annotated tag named deploy-NNNN, and the tagger date is when it shipped.
git -C fixture tag -l 'deploy-*' | wc -l
git tag -a v1.0 -m 'Release version one'
git push origin v1.0
git tag v1.2.0 && git push origin v1.2.0
In Terraform: Modules kept in Git are pinned by tag in the source address, because the version argument only works for registry sources. The Terraform Registry also publishes module versions from tags.

Related terms

Taught in

References

Certification courses