There are alot of methods to get latest tags when you have local git repo.
But i want to get list of latest tags on remote repo.
I know about \"git ls-remot
With Git 2.18 (Q2 2018), git ls-remote learned an option to allow sorting its output based on the refnames being shown.
See commit 1fb20df (09 Apr 2018) by Harald Nordgren (HaraldNordgren).
(Merged by Junio C Hamano -- gitster -- in commit 6c0110f, 08 May 2018)
ls-remote: create '--sort' optionCreate a '
--sort' option forls-remote, based on the one fromfor-each-ref.
This e.g. allows ref names to be sorted by version semantics, so thatv1.2is sorted beforev1.10.
So check out those for-each-ref --sort options introduced in Git 2.0 and 2.8, because they apply now to git ls-remote --sort.