tags:

views:

973

answers:

2

I run

git tag v1.0.0 -m 'finally a stable release'

I want to see a list of my Git tags.

How can you see a list of Git tags?

+8  A: 
git tag

should be enough.
You also have:

-l <pattern>

List tags with names that match the given pattern (or all if no pattern is given).
Typing "git tag" without arguments, also lists all tags.

Note: the git ready article on tagging disapprove of lightweight tag.

Without arguments, git tag creates a “lightweight” tag that is basically a branch that never moves.
Lightweight tags are still useful though, perhaps for marking a known good (or bad) version, or a bunch of commits you may need to use in the future.
Nevertheless, you probably don’t want to push these kinds of tags.

Normally, you want to at least pass the -a option to create an unsigned tag, or sign the tag with your GPG key via the -s or -u options.


That being said, Charles Bailey points out that a 'git tag -m "..."' actually implies a proper (unsigned annotated) tag (option '-a'), and not a lightweight one. So you are good with your initial command.

VonC
@VonC: Thank you for your answer!
Masi
It's probably worth adding that -m or -F implies -a (if non of -a, -s or -u are supplied explicitly. You can't have a tag message without creating a 'proper' tag object.
Charles Bailey
@Charles: good point. I have updated my answer accordingly
VonC
+1  A: 

To list tags I prefer:

git tag -n

The -n flag displays the first line of the annotation message along with the tag.

finn