Skip to content

Instantly share code, notes, and snippets.

@juanfgs
Created March 14, 2016 14:05
Show Gist options
  • Save juanfgs/188839272423ec12bd3f to your computer and use it in GitHub Desktop.
Save juanfgs/188839272423ec12bd3f to your computer and use it in GitHub Desktop.
#!/bin/bash
inc()
{
shopt -s extglob
num=$(echo "$release_version" | sed 's/^[0-9]*\.[0-9]*\.//g')
let num++
echo $release_version | sed -r s/[0-9]*$/$num/
}
release_version=`git branch | grep -n -e 'release' | sed 's/^[^-]*-//g'`
new_version=$(inc)
git co master
git me release-$release_version
git tag -a $release_version -m "Release $release_version"
git co development
git me release-$release_version
git cob release-$new_version
git push origin master
git push origin --tags
git push origin development
git push --set-upstream origin release-$new_version
git push origin :release-$release_version
git branch -d release-$release_version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment