Search code examples
gitgit-tag

Show git tags sorted by date


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

git tag only displays alphabetical order.


Solution

  • 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.