Skip to content

Instantly share code, notes, and snippets.

@mazuhl
Created May 16, 2012 14:06
Show Gist options
  • Save mazuhl/2710595 to your computer and use it in GitHub Desktop.
Save mazuhl/2710595 to your computer and use it in GitHub Desktop.
Git - get second most recent tag
git for-each-ref --format='%(taggerdate:iso8601) %(refname:short)' refs/tags | grep -v '^ ' | sort | cut -d ' ' -f4- | tail -2 | head -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment