How to list only version tags with git-log?

早过忘川 提交于 2019-12-23 03:48:07

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!