Created
September 13, 2011 15:09
-
-
Save kylelemons/1214055 to your computer and use it in GitHub Desktop.
Use git to make release branches for Go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -ve | |
[[ -z "$1" ]] && echo "Usage: release.sh <branchname>" && exit 1 | |
BRANCH=$(git branch | grep "^\*" | cut -c 3-) | |
RELEASE="$1" | |
git branch | cut -c 3- | grep "^${RELEASE}\$" && git checkout $RELEASE || git checkout -b $RELEASE | |
git merge $BRANCH | |
git push | |
git checkout $BRANCH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment