How to get the latest release tag in git and the distance to HEAD

Viewed 3702

Using https://github.com/google/glog as an example. The latest release is 0.3.5.

After searching hours on stackoverflow and google, I am not able to find a correct answer.

git describe 

shows

v0.3.3-147-gb3695ee

and

git describe --tags

shows

v0.3.4-133-gb3695ee

and

git describe --tags `git rev-list --tags --max-count=1`

shows

v0.3.5

What command should I type in order to get

v0.3.5-41-gb3695ee
1 Answers
Related