How to list all Git tags?

前端 未结 10 2344
囚心锁ツ
囚心锁ツ 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 17:57

    If you want to check you tag name locally, you have to go to the path where you have created tag(local path). Means where you have put your objects. Then type command:

    git show --name-only <tagname>
    

    It will show all the objects under that tag name. I am working in Teradata and object means view, table etc

    0 讨论(0)
  • 2020-11-28 18:11

    To list tags I prefer:

    git tag -n
    

    The -n flag displays the first line of the annotation message along with the tag, or the first commit message line if the tag is not annotated.

    You can also do git tag -n5 to show the first 5 lines of the annotation.

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-11-28 18:12

    And here is how you find the remote tags:

    git ls-remote --tags origin

    0 讨论(0)
提交回复
热议问题