How to find the tag associated with a given git commit?

后端 未结 6 672
感情败类
感情败类 2020-12-23 02:41

For releases I usually tag with something like v1.1.0. During my build script I am creating a fwVersion.c file that contains the current git info. Currently, I have commit

6条回答
  •  心在旅途
    2020-12-23 03:17

    How about this?

    git tag --points-at

    It gives you all the tags the given commit has (whereas git describe only gives you one), and does not include tags on descendant commits (like git tag --contains does).

提交回复
热议问题