Skip to content

Instantly share code, notes, and snippets.

@clupprich
Created March 16, 2013 14:17
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 clupprich/5176572 to your computer and use it in GitHub Desktop.
Save clupprich/5176572 to your computer and use it in GitHub Desktop.
git tag for semantic versions
#!/bin/bash
# Sorts the output of `git-tag` correctly for version string like v1.2.3.4.
# Save this file somewhere in your bin path and execute with git tag-semantic
semantic_tags=$(git tag | sort -n -t. -k1,1 -k2,2 -k3,3 -k4,4)
echo "$semantic_tags"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment