Skip to content

Instantly share code, notes, and snippets.

@davidfrey
Last active August 29, 2015 14:01
Show Gist options
  • Save davidfrey/baafc5e2fcd3f88b1341 to your computer and use it in GitHub Desktop.
Save davidfrey/baafc5e2fcd3f88b1341 to your computer and use it in GitHub Desktop.
git last-tag
[alias]
last-tag = !sh -c 'git describe --tags `git rev-list --tags --max-count=1`'
stable = !sh -c 'git describe --tags `git rev-list --tags=releases/ --max-count=1`'
@davidfrey
Copy link
Author

When you just want to know what the latest tag was. Helpful usage:

git fetch --tags
git checkout `git last-tag`
git checkout -b new-branch-from-last-release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment