Created
July 19, 2013 03:59
-
-
Save koko1000ban/6035046 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/sh | |
# enable debug mode | |
if [ "$DEBUG" = "yes" ]; then | |
set -x | |
fi | |
usage() { | |
echo "usage: git merge-master <release_version>" | |
echo | |
echo "this command exec creating release branch and merge it to master branch" | |
echo | |
} | |
main() { | |
if [ $# -lt 1 ]; then | |
usage | |
exit 1 | |
fi | |
RELESE_VERSION=$1 | |
CURRENT_BRANCH=`git symbolic-ref --short HEAD` | |
if ! [ "$CURRENT_BRANCH" = 'develop' ]; then | |
git checkout develop | |
fi | |
git pull --rebase | |
git checkout -b release/$RELESE_VERSION | |
git checkout master | |
git merge --no-ff release/$RELESE_VERSION | |
git push origin master | |
git push origin release/$RELESE_VERSION | |
} | |
main "$@" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment