Jon Ursenbach Jon Ursenbach - 3 months ago 8
Git Question

How can I list all tags in my Git repository by the date they were created?

I need some way to list all tags in my system by the date they were created but am not sure if I can get that data via git-log. Ideas?

Answer

If it’s an annotated tag, you can use the tag date:

git for-each-ref --sort=taggerdate --format '%(refname) %(taggerdate)' refs/tags

But if it’s a lightweight tag, there’s no information about when it was created (all it does is name an object).