Skip to content

Instantly share code, notes, and snippets.

@seeRead
Created January 13, 2012 19:17
Show Gist options
  • Save seeRead/1608206 to your computer and use it in GitHub Desktop.
Save seeRead/1608206 to your computer and use it in GitHub Desktop.
One line is better than four
#!/bin/bash
set -e
usage()
{
echo "usage: `basename ${0}` [-h]
This script creates a new branch and sets upstream to origin. Specify the branch name as the first and only argument.
" >&2
exit $1
}
git branch $1
git checkout $1
git push origin refs/heads/$1
git branch --set-upstream $1 origin/$1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment