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?
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?
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.
To list tags I prefer:
git tag -n
The -n
flag displays the first line of the annotation message along with the tag.