git 命令显示所有(轻量级)标签创建日期
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6900328/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
git command to show all (lightweight) tags creation dates
提问by Dror Cohen
Is there a one liner that shows me the dates where all git lightweight tags where created ?
是否有一个班轮向我显示所有 git 轻量级标签的创建日期?
Something like: git show tags --format=date
?
类似的东西:git show tags --format=date
?
回答by Dror Cohen
I found in this linka solution that fits my needs:
我在此链接中找到了适合我需求的解决方案:
git log --tags --simplify-by-decoration --pretty="format:%ai %d"
I've put that command in an alias in my ~/.alias
, so now everytime I run gitshowtagbydate
I get what I needed.
我已经将该命令放在了我的别名中~/.alias
,所以现在每次运行gitshowtagbydate
我都会得到我需要的。
回答by vdboor
The git tag -l
shows a list of all tags. The --format
argument can be used to define a custom output. For example:
将git tag -l
显示所有标签的列表。该--format
参数可用于定义自定义输出。例如:
git tag -l --format='%(refname) %(taggerdate)'
Update, based on the comments below:
更新,基于以下评论:
git tag -l --sort=-creatordate --format='%(creatordate:short): %(refname:short)'