Skip to content

Instantly share code, notes, and snippets.

@carlwiedemann
Created October 24, 2012 16:14
Show Gist options
  • Select an option

  • Save carlwiedemann/3947045 to your computer and use it in GitHub Desktop.

Select an option

Save carlwiedemann/3947045 to your computer and use it in GitHub Desktop.
Git deploy
# Usage: (From [current branch])
#
# $> gitdeploy [to branch]
#
# This will checkout [to branch], merge --no-ff [current branch] with auto
# message, push [to branch] to remote, & re-checkout current.
function gitdeploy() {
# Get branch we are on
CURRENT=`git branch | grep ^\* | awk '{print $2}'`
git checkout $1 && git merge --no-ff $CURRENT -m "Merging $CURRENT" && git push && git checkout $CURRENT
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment