With git describe
you can get the number of commits since the last tag. If you only had the tag and the number of commits what is the best way to show the commit t
As Kevin's answer explained, this is generally not possible. To solve the problem for special cases he mentioned:
That said, if you don't have a bunch of parallel branches going on at once, then you may be able to resolve a given commit number back to a single commit, but if you have even a single active side branch at the time of your tag then this may not work.
you can use the following command (with n
being the number of commits since the tag)
git rev-list tag..HEAD --reverse | awk NR==n