Skip to content
Create a gist now

Instantly share code, notes, and snippets.

@rud /
Created May 19, 2010

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
Something went wrong with that request. Please try again.