Ad space (banner)
🌿Git Lessons
Lesson 59 / 59

Searching Tags by Pattern with git tag -l

This lesson covers searching tags by pattern with git tag -l. It's for anyone searching "git tag -l usage."

git tag -l lists your registered tags, and given a pattern, it narrows the search down to just the tags matching it.

In Try It, run git tag -l "v1.*". Only tags starting with v1., like v1.0 or v1.1, are listed.

A common early mistake is misjudging how the pattern syntax works — it's a simple search using * as a wildcard, and it doesn't support anything as complex as a full regular expression, which is worth keeping in mind. In real teams, this kind of search is helpful on a project that has accumulated many version tags, whenever you want to check just the tags for one particular major version.

Git
Try it (type this into the pseudo terminal)
git tag -l "v1.*"

🧑‍💻 You can type this command into the Git pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)