Skip to content

Instantly share code, notes, and snippets.

@nopolabs
Forked from kjantzer/previous-git-tag.sh
Last active September 28, 2016 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nopolabs/723e62b097d278403f6a41b246cbdec0 to your computer and use it in GitHub Desktop.
Save nopolabs/723e62b097d278403f6a41b246cbdec0 to your computer and use it in GitHub Desktop.
Get Previous Git Tag (the one before the latest tag on trunk)
# http://stackoverflow.com/a/28818420/484780
git describe --abbrev=0 --tags `git rev-list --first-parent --tags --skip=1 --max-count=1`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment