问题
I want to create a (latex) table of tags and theirs messages straight out of git, therefor I need to get all tags that match a pattern like:
/^v([0-9]|\.)*/
or so.
How to do this? My attempt:
git log --all --tags --grep="^v([0-9]|\.)*" --pretty=format:"%d & %s & %b"
fails and returns nothing (tested on the linux kernel source tree).
回答1:
$ git for-each-ref --format='%(objectname)' \
'refs/tags/v.*' 'refs/tags/v[0-9]*' | \
xargs -n 1 git log -1 --pretty=format:"%d & %s & %b"
来源:https://stackoverflow.com/questions/19848120/how-to-list-only-version-tags-with-git-log