A tag is a way to mark a commit with a simple name
It can be seen as an alias to the commit hash
They are usually used to mark important commits, such as releases
Sometimes, they are important for some automated tools
git tag <tag_name> [<commit_hash>]
The tag command requires a name for the tag and optionally the hash of the commit which has to be tagged (If no hash is provided the "last" commit will be tagged)
tag names must be short and simple,-m
, followed by the message
git tag v1.2.0 be4f621
A pointer is added to the commit with the specified name
The command git tag
without arguments lists the repository's tags
Branches and tags both point to a commit
From git's point of view they are technically the same
Those "pointers to a commit" are called references, or refs