Tags

tags

Another interesting concept in git are commit pointers,
in git these are called tags

A tag identifies a specific commit with a meaningful name, replacing the complicated hash

tags

What are they for?

Tags are used to identify a commit as a significant one

e.g. tags could be used to identify the commit of a specific release of a program

tags

How can we create a tag?

git tag <tag_name> [<commit_hash>]

The command tag 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)

n.b. tag name 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

tags

How can we get the list of tags?

Simply using

git tag
v1.0
v1.1.1
v1.2.0
(END)

tag without parameters returns the list of the repository tags