Annotated Tags
An annotated tag carries a message and a name. It is the kind of tag worth sharing.
Make an annotated tag
The tag names the version and says what it holds.
$ git tag -a v1.1 -m "First shared shopping list"
$ git tagRead the tag
Show prints the message first, then the snapshot it marks.
$ git show v1.1 --statExample
$ git tag -a v1.1 -m "First shared shopping list"
$ git tag
$ git show v1.1 --statKey points
- Tag with -a and -m to write a message.
- The message says what the version holds.
- Show prints the tag message above the snapshot.
- The tag records who made it and when.
- Annotated tags are the normal choice for releases.
- Lightweight tags suit quick marks on your own machine.
Here, the tag carries its message. Show prints the message first, then the snapshot it marks.
Try it Yourself
Edit the code, then press Run.
Running is simulated
Exercise
What does an annotated tag carry?