Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Hoang Nguyen hoangbkit

🏠
Working from home
View GitHub Profile
@hoangbkit
hoangbkit / git-utils.sh
Last active Jul 31, 2018 — forked from rponte/get-latest-tag-on-git.sh
Getting latest tag on git repository
View git-utils.sh
# 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