获取git标签的时间和日期 [英] Get the time and date of git tags

查看:918
本文介绍了获取git标签的时间和日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个正在使用git的项目,并用标签标记了所有发行版。

I have a project that is using git and have tagged all the releases with a tag.

$ git tag
v1.0.0
v1.0.1
v1.0.2
v1.0.3
v1.1.0

我的目标是在Web界面中列出发行和发行日期(标签/提交日期=发行日期)。当前,我们使用 git标签列出所有发行版。

My goal is to list the releases and release dates in a web interface (tag/commit date = release date). Currently we list all the releases by using git tag.

如何获取时间和日期

推荐答案

使用-format git log 的参数:

git log -1 --format=%ai MY_TAG_NAME

这篇关于获取git标签的时间和日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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