How to list all tags pointing to a specific commit in git
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have seen the commands git describe and git-name-rev but I have not managed to get them to list more than one tag. Example: I have the sha1 48eb354 and I know the tags A and B point to it. So I want a git command git {something} 48eb354 that produce output similar to "A, B". I am not interested in knowing references relative other tags or branches just exact matches for tags. 回答1: git show-ref --tags -d | grep ^48eb354 | sed -e 's,.* refs/tags/,,' -e 's/\^{}//' should work for both lightweight and annotated tags. 回答2: git tag --points-at