Created
October 26, 2009 07:02
-
-
Save kogakure/218467 to your computer and use it in GitHub Desktop.
Bash: Git - New remote branch
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/sh | |
# http://www.zorched.net/2008/04/14/start-a-new-branch-on-your-remote-git-repository/ | |
# git-create-branch <branch_name> | |
if [ $# -ne 1 ]; then | |
echo 1>&2 Usage: $0 branch_name | |
exit 127 | |
fi | |
branch_name=$1 | |
git push origin master:refs/heads/$branch_name | |
echo "git push origin master:refs/heads/$branch_name" | |
git fetch origin | |
git checkout --track -b $branch_name origin/$branch_name | |
git pull |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment