Tags

Author

Marie-Hélène Burle

When you reach an important point in the development of a project, it is convenient to be able to identify the next commit easily. Rather than having to look for it through date, commit message, or hash, you can create a tag: a pointer to that commit.

Leightweight tag

You create a tag with:

git tag <tag-name>

Example:

git tag J_Climate_2009

noshadow

As you keep developing the project and create new commits, the branch and HEAD pointers will move along, but the tag remains on your important commit.

noshadow

At any time, you can get info on the commit thus tagged with:

git show J_Climate_2009

Or you can check it out with:

git checkout J_Climate_2009

Annotated tag

A more sophisticated form of tag comes with a message:

git tag -a <tag-name> -m "<message>"
git tag -a J_Climate_2009 -m "State of project at the publication of paper"

List tags

git tag

Deleting tags

git tag -d <tag-name>
git tag -d J_Climate_2009