Dwelle Dwelle - 2 months ago 6
Git Question

what does the hash from `git describe` refer to?

$ git describe --tags --long
test-1-g3c31c73
\_ ???


The
g3c31c73
doesn't seem to point to anything... The doc says it's the abbreviated object name of the most recent commit, but it's not the HEAD commit hash, and
find .git/objects -type f | grep g3c31c73
finds nothing.

Answer

The "g" isn't a part of the commit.

Try looking for a commit 3c31c73 using git show 3c31c73.

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. This is useful in an environment where people may use different SCMs.

Comments