Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Bash 特定时期的Git列表标记_Bash_Git - Fatal编程技术网

Bash 特定时期的Git列表标记

Bash 特定时期的Git列表标记,bash,git,Bash,Git,我知道我可以这样列出所有标签及其创建者日期: git tag -l --format='%(refname) %(creatordate)' --sort=creatordate 但是如果我只对2008年创建的标签感兴趣呢?或者可能是从2创建的标记。3.2015年至6月。8.2016? 有没有一种只使用git的方法?还是必须解析输出?使用。例如,以简单的可浏览格式列出标签及其创建日期和过滤器: git for-each-ref refs/tags/ --format='%(refname) %

我知道我可以这样列出所有标签及其创建者日期:

git tag -l --format='%(refname) %(creatordate)' --sort=creatordate
但是如果我只对2008年创建的标签感兴趣呢?或者可能是从2创建的标记。3.2015年至6月。8.2016? 有没有一种只使用git的方法?还是必须解析输出?

使用。例如,以简单的可浏览格式列出标签及其创建日期和过滤器:

git for-each-ref refs/tags/ --format='%(refname) %(creatordate:short)' | grep 2008-
如果您需要比simple
grep
更好的过滤,请以更细粒度的可解析格式打印日期,并使用您自己的脚本解析输出:

git for-each-ref refs/tags/ --format='%(refname) %(creatordate:iso-strict)'
有关可能的日期格式列表,请参阅