Tags

Tags

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

Tags

How to create a tag?

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,
for more complex notes you can also add a message with the argument -m, followed by the message
Tags

Tag a specific commit

git tag v1.2.0 be4f621
tag

A pointer is added to the commit with the specified name

The command  git tag  without arguments lists the repository's tags

Tags

References

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