Create a gist now

Instantly share code, notes, and snippets.

Create a remote git branch & checkout locally (with tracking)
if [ -z $1 ]; then
echo STDERR "Usage: $0 [branchname]"
exit 1
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