Skip to content

Instantly share code, notes, and snippets.

@jamiew
Created October 25, 2010 20:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamiew/645626 to your computer and use it in GitHub Desktop.
Save jamiew/645626 to your computer and use it in GitHub Desktop.
Create a remote git branch & checkout locally (with tracking)
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