snippetbashTip
git describe — Give an object a human-readable name based on an available ref. More information: <https://git-scm.c
Viewed 0 times
commandobjectgit describereadablenamecligivehuman
Problem
How to use the
git describe command: Give an object a human-readable name based on an available ref. More information: <https://git-scm.com/docs/git-describe>.Solution
git describe — Give an object a human-readable name based on an available ref. More information: <https://git-scm.com/docs/git-describe>.Create a unique name for the current commit (the name contains the most recent annotated tag, the number of additional commits, and the abbreviated commit hash):
git describeCreate a name with 4 digits for the abbreviated commit hash:
git describe --abbrev={{4}}Generate a name with the tag reference path:
git describe --allDescribe a Git tag:
git describe {{v1.0.0}}Create a name for the last commit of a given branch:
git describe {{branch_name}}Code Snippets
Create a unique name for the current commit (the name contains the most recent annotated tag, the number of additional commits, and the abbreviated commit hash)
git describeCreate a name with 4 digits for the abbreviated commit hash
git describe --abbrev={{4}}Generate a name with the tag reference path
git describe --allDescribe a Git tag
git describe {{v1.0.0}}Create a name for the last commit of a given branch
git describe {{branch_name}}Context
tldr-pages: common/git describe
Revisions (0)
No revisions yet.