git-describe
Generate human-readable names for commits
TLDR
Describe current commit
SYNOPSIS
git describe [options] [commit]
DESCRIPTION
git describe gives a human-readable name to a commit based on available tags. It finds the most recent tag reachable from the commit and describes the distance from it.
Output format is tag-distance-gSHA, like "v1.0.2-14-g2414721" meaning 14 commits after v1.0.2. If the commit is directly on a tag, just the tag name is returned. This is commonly used for generating version strings in build systems.
PARAMETERS
COMMIT
Commit to describe (default: HEAD).--tags
Use any tag, not just annotated.--long
Always output long format.--match PATTERN
Only consider matching tags.--abbrev N
Abbreviation length.--always
Show commit abbrev if no tag found.--help
Display help information.
CAVEATS
Requires tags in history. Annotated tags preferred by default. Distance counting can be slow.
HISTORY
git describe is a core Git command, essential for generating version strings from repository state.
SEE ALSO
git-tag(1), git-log(1), git-rev-parse(1)
