public
Last active

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

  • Download Gist
chop.sh
Shell
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}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.