Skip to content

Instantly share code, notes, and snippets.

@rud
Created May 19, 2010 12:43
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rud/406262 to your computer and use it in GitHub Desktop.
Save rud/406262 to your computer and use it in GitHub Desktop.
chop - remove the current branch in git, switch to master
#!/bin/sh -x
set -o errexit
CURRENT_BRANCH=$(git branch | grep '\*')
git checkout ${1:-"master"} || exit 1
git branch -d ${CURRENT_BRANCH:2}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment