Skip to content

Instantly share code, notes, and snippets.

@dhh
Created November 30, 2008 11:40
Show Gist options
  • Save dhh/30422 to your computer and use it in GitHub Desktop.
Save dhh/30422 to your computer and use it in GitHub Desktop.
#!/bin/sh
# git-create-remote-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
echo "created ${branch_name} as a remote branch"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment