How To List Git Tags In Order

at in tips

Tags on Git are usually used to mark versions, specific points in the project’s timeline that represents a release, but the command git tag returns the list in numerical order which means that 0.2.2 will come after 0.2.19.

To retrieve the list of tags in the order that they were created you can use:

git tag --sort=committerdate

And if by some weird reason someone created a tag out of order you can still get it listed in order using the external command sort using the flag –version-sort.

git tag | sort --version-sort

See Also