Jenkins Git plugin: git describe cannot describe anything Jenkins Git plugin: git describe cannot describe anything jenkins jenkins

Jenkins Git plugin: git describe cannot describe anything


Regarding tags (as described in "Git Tip of the Week: Tags")

If no annotated tags are found then it will print fatal: No names found, cannot describe anything.
To allow describe to use non-annotated tags, run with git describe --tags.
It’s also possible to get it to describe against a branch using git describe --all, although this only makes sense if the branch is known remotely.

So it is possible that your current repo against which the Git Plugin is doing a simple git describe doesn't contain any annotated tag (which explains why a checkout of a tip of a branch doesn't solve the issue: this isn't about a DETACHED HEAD situation)

You need to clone the repo, including the tags.


Actually, the OP Jasper Van Den Bosch reports:

I wasn't pushing the tags correctly

No tags pushed, means Jenkins doesn't get those tags when updating its own clone, means the git describe cannot work properly.


git describe doesn't work until you have a tag (preferable an annotated tag) in the history before what is currently checked out.

/tmp/repo$ git describefatal: No names found, cannot describe anything./tmp/repo$ git tag foo/tmp/repo$ git describefatal: No annotated tags can describe '14d827c72b2f277a5cd3e65e7b0e0502edc58fa3'.However, there were unannotated tags: try --tags./tmp/repo$ git tag -a 'annotated-tag' -m 'whatever'/tmp/repo$ git describeannotated-tag