Skip to content

Instantly share code, notes, and snippets.

@ceronman
Created October 18, 2011 17:35
Show Gist options
  • Select an option

  • Save ceronman/1296066 to your computer and use it in GitHub Desktop.

Select an option

Save ceronman/1296066 to your computer and use it in GitHub Desktop.
Git new branch
#!/bin/bash
set -x -e
# update master first
git checkout master
git pull upstream master
git push origin master
case $# in
1) BRANCH="$1";;
*) echo "Usage: `basename $0` branchname" >&2; exit 1;;
esac
git branch $BRANCH
git co $BRANCH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment