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

前端 未结 8 560
忘了有多久
忘了有多久 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:38

    git tag -l --format='%(contents)'
    

    or

    git for-each-ref refs/tags/ --format='%(contents)'
    

    will output full annotation message for every tag (including signature if its signed).

    • %(contents:subject) will output only first line
    • %(contents:body) will output annotation without first line and signature (useful text only)
    • %(contents:signature) will output only PGP-signature

    See more in man git-for-each-ref “Field names” section.

提交回复
热议问题