Get the time and date of git tags

HNygard picture HNygard · Nov 3, 2012 · Viewed 43.8k times · Source

I have a project that is using git and have tagged all the releases with a tag.

$ git tag
v1.0.0
v1.0.1
v1.0.2
v1.0.3
v1.1.0

My goal is to list the releases and release dates in a web interface (tag/commit date = release date). Currently we list all the releases by using git tag.

How can I get the time and date for when the tag was made (or the commit it points to)?

Answer

Nikos C. picture Nikos C. · Nov 3, 2012

This always worked for me:

git log --tags --simplify-by-decoration --pretty="format:%ci %d"

Consult the "PRETTY FORMATS" section of the git-log manpage for details of the format string if you want a different date formatting.