Skip to content

Instantly share code, notes, and snippets.

@eteubert
Created January 17, 2011 19:03
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 eteubert/783283 to your computer and use it in GitHub Desktop.
Save eteubert/783283 to your computer and use it in GitHub Desktop.
2 branches: master = live, dev = development
# start work on a new feature
# creates a new branch based on the latest stable version (which is master)
function gfnew () {
git checkout master
git checkout -b $*
}
# make the feature available in dev.ingame.de
# push changes to dev and then checkout featurebranch again
# so you can continue to work on it immediately
function gfdev () {
CURBRANCH=`git branch | grep \* | awk '{print $2}'`
git checkout dev
git merge $CURBRANCH
git push origin dev
git checkout $CURBRANCH
}
# release the feature
# push to dev & master (live system) and delete the branch
function gfrelease () {
CURBRANCH=`git branch | grep \* | awk '{print $2}'`
git checkout dev
git merge $CURBRANCH
git checkout master
git merge $CURBRANCH
git branch -d $CURBRANCH
git push
}
function gflive () {
git tag -f stable
git pull
echo -n "Is everything running smoothly? [y/N] "
read choice
if [ "$choice" != "y" ]; then
git checkout stable
echo "Now fix this and come again."
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment