Created
January 13, 2012 19:17
-
-
Save seeRead/1608206 to your computer and use it in GitHub Desktop.
One line is better than four
This file contains 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/bash | |
set -e | |
usage() | |
{ | |
echo "usage: `basename ${0}` [-h] | |
This script creates a new branch and sets upstream to origin. Specify the branch name as the first and only argument. | |
" >&2 | |
exit $1 | |
} | |
git branch $1 | |
git checkout $1 | |
git push origin refs/heads/$1 | |
git branch --set-upstream $1 origin/$1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment