Created
October 24, 2012 16:14
-
-
Save carlwiedemann/3947045 to your computer and use it in GitHub Desktop.
Git deploy
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
| # 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