获取Git排序的最新n个可到达标签

时间:2018-04-25 15:11:33

标签: git

git describe检索最新的可访问标记。

git tag --list检索所有标记。

我需要接近git描述的内容,但要检索 N个最新标记,N = 1,2,3 ... 可达已排序按创作日期。

1 个答案:

答案 0 :(得分:0)

试试这个:

git tag --sort=-creatordate | tail -n <N>

或以相反的顺序:

git tag --sort=creatordate | tail -n <N>