如何仅使用git-log列出版本标签? [英] How to list only version tags with git-log?

查看:110
本文介绍了如何仅使用git-log列出版本标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个(latex)表标签和他们的消息直接出git,因此我需要获得匹配模式的所有标签,如:

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]|\.)*/

左右。

如何做到这一点?我的尝试:

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).

推荐答案

$ 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"

这篇关于如何仅使用git-log列出版本标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆