git describe --abbrev=0

Category: Git - Core

git describe --abbrev=0

Get the nearest tag name only

Prints the most recent tag reachable from HEAD without the commit-count and hash suffix git describe normally appends. CI scripts use it as a clean version number. Fall back to --always for repositories with no tags.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.