Skip to content

Instantly share code, notes, and snippets.

View machi1990's full-sized avatar
💭
I may be slow to respond.

Manyanda Chitimbo machi1990

💭
I may be slow to respond.
  • Red Hat
  • Paris
View GitHub Profile
@rponte
rponte / get-latest-tag-on-git.sh
Last active October 17, 2024 20:03
Getting latest tag on git repository
# The command finds the most recent tag that is reachable from a commit.
# If the tag points to the commit, then only the tag is shown.
# Otherwise, it suffixes the tag name with the number of additional commits on top of the tagged object
# and the abbreviated object name of the most recent commit.
git describe
# With --abbrev set to 0, the command can be used to find the closest tagname without any suffix:
git describe --abbrev=0
# other examples