0

I was playing with git describe:

git branch
  branch1
* master

git tag tag1 HEAD~2

git tag tag2 HEAD

git describe --all HEAD~1
tags/tag1-1-gb772e8b

git rev-parse tag1
1ae346a3b91f5dbe4110ae143ce86825d79b82f3

What does it mean by "1-gb772e8b" in "tag1-1-gb772e8b" ?

Number945
  • 4,631
  • 8
  • 45
  • 83

1 Answers1

6
tag1-1-gb772e8b
^    ^  ^ 
|    |  |
|    |  git hash of the commit  
|    |
|   number of commits after the tag 
|
|
Most recent tag

This is all in reference to the commit you are giving to git describe. In your case it is HEAD~1, so

  • HEAD~1 has commit hash b772e8b
  • HEAD~1 is 1 commit after the most recent tag
  • the most recent tag older than HEAD~1 is tag1

See the documentation for more in-depth information, the output depends on whether there are any tags, and what state the repository is in and arguments you provide to git describe

There's also a g in the hash,gb772e8b. The docs describe it as

The "g" prefix stands for "git" and is used to allow describing the version of a software depending on the SCM the software is managed with.

nos
  • 223,662
  • 58
  • 417
  • 506