Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show git tags sorted by date

Tags:

How to list git tags in chronological order? (recent tags first)

git tag only displays alphabetical order.

like image 372
Totor Avatar asked Jan 28 '14 19:01

Totor


Video Answer


2 Answers

The correct answer is:

git tag --sort=-taggerdate 

taggerdate is the appropriate field. According to the git tag man page:

Prefix - to sort in descending order of the value.

git tag uses the same sorting keys as git-for-each-ref, which is where the sorting keys are documented.

like image 80
Zamicol Avatar answered Oct 09 '22 03:10

Zamicol


In git 2.3.3 I can just do this to get them sorted by date:

git tag --sort version:refname 
like image 40
opsidao Avatar answered Oct 09 '22 03:10

opsidao