How to get list of latest tags in remote git?

后端 未结 4 1316
余生分开走
余生分开走 2020-12-24 06:05

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

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-24 06:30

    some guy told me that command:

    git ls-remote -t repo.url.git | awk '{print $2}' | cut -d '/' -f 3 | cut -d '^' -f 1  | sort -b -t . -k 1,1nr -k 2,2nr -k 3,3r -k 4,4r -k 5,5r | uniq
    

    and this is not the best solution, but he opened my eyes on command sort.

    but i would like to know other versions.

提交回复
热议问题