How to list all Git tags?

前端 未结 10 2371
囚心锁ツ
囚心锁ツ 2020-11-28 17:40

In my repository, I have created tags using the following commands.

git tag v1.0.0 -m \'finally a stable release\'
git tag v2.0.0 -m \'oops, there was still         


        
10条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-28 18:11

    You can list all existing tags git tag or you could filter the list with git tag -l 'v1.1.*', where * acts as a wildcard. It will return a list of tags marked with v1.1.

    You will notice that when you call git tag you do not get to see the contents of your annotations. To preview them you must add -n to your command: git tag -n2.

    $ git tag -l -n2
    

    v1.0 Release version 1.0

    v1.1 Release version 1.1

    The command lists all existing tags with maximum 3 lines of their tag message. By default -n only shows the first line. For more info be sure to check this tag related article as well.

提交回复
热议问题