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

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

提交回复
热议问题