Git List Tags From A Certain Period

- 1 answer

I know I can list all tags and their creator dates this way:

git tag -l --format='%(refname) %(creatordate)' --sort=creatordate

But what if I am only interested in tags created in the year 2008? Or maybe tags created from 2. 3. 2015 to 6. 8. 2016? Is there a way to do this using git only? Or do I have to parse the output?



Use git for-each-ref refs/tags/. For example list tags with their creation date in short simple greppable format and filter:

git for-each-ref refs/tags/ --format='%(refname) %(creatordate:short)' | grep 2008-

If you need better filtering than simple grep print dates in more fine-grained parseable format and parse the output with your own script:

git for-each-ref refs/tags/ --format='%(refname) %(creatordate:iso-strict)'

For the list of possible date formats see git rev-list --date=<format>.