The issue is git tag
shows all tags in all branches while git describe
only uses tags on commits which are available in the current branch.
Here is an example (the reason why I came here actually):
$ git tag | tail -n3
v0.4.0
v0.4.1
v0.4.2
It shows the latest tag available is v0.4.2
, but this is my output of git describe
:
$ git describe --tags
v0.4.0-2-acd334c
I'm on develop branch. When I dig into the log, I see indeed the most recent tags are not available on the current branch:
$ git log --oneline --decorate=short | grep 'tag\:' | head -n3
acd334c (tag: v0.4.0) Merge pull request #1061
988fe5e (tag: v0.3.6) Merge pull request #859
5f97274 (tag: v0.3.5) Merge pull request #646
So in my case, the developers decided to create a new release branch exclusively for tagging releases which results that the develop branch is not up to date with the tags anymore.
Hope that helps and thanks @eis for the idea with checking the logs.