Question:
I have a project that is using git and have tagged all the releases with a tag.
1 2 3 4 5 6 7 |
$ 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:
Use the --format
argument to git log
:
1 2 |
git log -1 --format=%ai MY_TAG_NAME |