Created
May 8, 2012 02:01
-
-
Save un33k/2631974 to your computer and use it in GitHub Desktop.
Create a git branch
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
#!/bin/sh | |
# git-create-branch <branch_name> | |
if [ $# -ne 1 ]; then | |
echo 1>&2 Usage: $0 branch_name | |
exit 127 | |
fi | |
set branch_name = $1 | |
git push origin origin: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