Skip to content

Instantly share code, notes, and snippets.

@kylelemons
Created September 13, 2011 15:09
Show Gist options
  • Save kylelemons/1214055 to your computer and use it in GitHub Desktop.
Save kylelemons/1214055 to your computer and use it in GitHub Desktop.
Use git to make release branches for Go
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