Skip to content

Instantly share code, notes, and snippets.

@pablo384
Forked from kjantzer/previous-git-tag.sh
Created November 8, 2019 15:30
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 pablo384/f7144394f7c5a2641d501d00c3baac54 to your computer and use it in GitHub Desktop.
Save pablo384/f7144394f7c5a2641d501d00c3baac54 to your computer and use it in GitHub Desktop.
Get Previous Git Tag (the one before the latest tag)
# http://stackoverflow.com/a/28818420/484780
git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment