为什么我的本地 git 标签从“hello”变成了“hello”?至“hello-1-48281”
$ git tag hello
$ git describe --tags
hello
... work work ...
$ git commit -m "work stuff"
$ git describe --tags
hello-1-48281
说什么?额外的东西是什么?看起来不像 SHA1...是否可以只回复“hello”?
$ git tag hello
$ git describe --tags
hello
... work work ...
$ git commit -m "work stuff"
$ git describe --tags
hello-1-48281
Say what? What's the extra stuff? Doesn't look like a SHA1... is it possible to just get "hello" back?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“git描述”可能不会做你认为它做的事情:
因此,在“hello-1-48281”的示例中,git 表示“
hello
标记与当前对象(即48281
)相隔 1 个提交。 ”如果您想要标签列表,只需执行 git tag -l 即可。
"git describe" probably doesn't do what you think it does:
So, in your example of "hello-1-48281", git is saying, "the
hello
tag is separated by 1 commit from the current object, which is48281
."If you want a list of tags instead, just do
git tag -l
.查看
gitdescribe
手册页,那里有描述。第一个数字是(在您的示例中)当前提交和标签之间的提交数量。
第二个应该是
g
加上当前提交的缩写 SH1。不确定在没有g
的情况下如何获得该数字,我无法在此处重现该数字。Look at the
git describe
man page, it's described in there.The first number is number of commits between (in your example) the current commit and the tag.
The second should be
g
plus an abbreviated SH1 of the current commit. Not sure how you got that number withoutg
, I can't reproduce that here.