Git describe giving different tags

寵の児 提交于 2019-12-04 15:58:25
CB Bailey

You probably used a "lightweight" tag. By default git describe only uses tag objects to describe a commit whereas with --tags it will use any reference under refs/tags even if they point directly to a commit rather than a tag object.

To create a tag object you must use one of -a (annotated) or -s or -u (signed) options to git tag, otherwise a lightweight tag (a reference pointing straight to a commit) will be created.

To see the difference between your two tags try:

git cat-file -t Release_V1.0.0.2

and:

git cat-file -t Release_v1.0.0.4

On will probably say "tag" and the other will say "commit".

To resolve the issue you can recreate the tag with -f and (say) -a.

git tag -f -a Release_v1.0.0.4 Release_v1.0.0.4
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!