How to list all tags along with the full message in git?

前端 未结 8 543
忘了有多久
忘了有多久 2020-12-07 07:12

I want git to list all tags along with the full annotation or commit message. Something like this is close:

git tag -n5

This does exactly w

相关标签:
8条回答
  • 2020-12-07 07:46

    Try this it will list all the tags along with annotations & 9 lines of message for every tag:

    git tag -n9
    

    can also use

    git tag -l -n9
    

    if specific tags are to list:

    git tag -l -n9 v3.*
    

    (e.g, above command will only display tags starting with "v3.")

    -l , --list List tags with names that match the given pattern (or all if no pattern is given). Running "git tag" without arguments also lists all tags. The pattern is a shell wildcard (i.e., matched using fnmatch(3)). Multiple patterns may be given; if any of them matches, the tag is shown.

    0 讨论(0)
  • 2020-12-07 07:53

    Mark Longair's answer (using git show) is close to what is desired in the question. However, it also includes the commit pointed at by the tag, along with the full patch for that commit. Since the commit can be somewhat unrelated to the tag (it's only one commit that the tag is attempting to capture), this may be undesirable. I believe the following is a bit nicer:

    for t in `git tag -l`; do git cat-file -p `git rev-parse $t`; done
    
    0 讨论(0)
提交回复
热议问题