Created
May 25, 2011 17:28
-
-
Save josephgrossberg/991425 to your computer and use it in GitHub Desktop.
Remote branch creation without editing config file
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
function gitbranch { | |
git checkout -b "$1"; | |
git push -u origin "$1"; | |
} | |
####################### | |
# create local branch | |
git branch foo | |
# push local branch to remote | |
git push origin foo | |
# delete local branch! | |
git branch -d foo | |
# checkout remote branch, which auto-creates a local, remote-tracking branch and switches to it | |
git checkout foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment