Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

chop - remove the current branch in git, switch to master

View chop.sh
1 2 3 4 5
#!/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.