Created
October 25, 2010 20:02
-
-
Save jamiew/645626 to your computer and use it in GitHub Desktop.
Create a remote git branch & checkout locally (with tracking)
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
if [ -z $1 ]; then | |
echo STDERR "Usage: $0 [branchname]" | |
exit 1 | |
fi | |
echo "Creating local+remote git branch: $1" | |
git push origin origin:refs/heads/$1 | |
git fetch origin | |
git checkout -b $1 --track origin/$1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment