Skip to content

Instantly share code, notes, and snippets.

@creeonix
Last active August 29, 2015 14:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save creeonix/b83d525969b2d1b5229b to your computer and use it in GitHub Desktop.
Save creeonix/b83d525969b2d1b5229b to your computer and use it in GitHub Desktop.
#!/bin/bash
git stash
git checkout release
git pull --tags
git checkout master
git pull
last_version=$(git for-each-ref --sort=taggerdate --format '%(refname)' refs/tags | tail -1 | grep -Eo '\d{1,2}\.\d{1,2}\.')
patch_level=$(git for-each-ref --sort=taggerdate --format '%(refname)' refs/tags | tail -1 | grep -Eo '[0-9]{1,2}$')
patch_level=$((patch_level+1))
new_version=$last_version$patch_level
git flow release start $new_version
git flow release finish $new_version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment