开发者

Why did my local git tag go from "hello" to "hello-1-48281"

$ git tag hello

$ git describe --tags
hello

... work wo开发者_JAVA百科rk ...
$ 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?


Say what? What's the extra stuff? Doesn't look like a SHA1... is it possible to just get "hello" back?

"git describe" probably doesn't do what you think it does:

DESCRIPTION
  The command finds the most recent tag that is reachable from a commit.
  If the tag points to the commit, then only the tag is shown. Otherwise,
  it suffixes the tag name with the number of additional commits on top
  of the tagged object and the abbreviated object name of the most recent
  commit.

So, in your example of "hello-1-48281", git is saying, "the hello tag is separated by 1 commit from the current object, which is 48281."

If you want a list of tags instead, just do git tag -l.


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 without g, I can't reproduce that here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜