Skip to content

Instantly share code, notes, and snippets.

@afroisalreadyinu
Created April 20, 2015 08:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afroisalreadyinu/97b3e0d8baccc83d692d to your computer and use it in GitHub Desktop.
Save afroisalreadyinu/97b3e0d8baccc83d692d to your computer and use it in GitHub Desktop.
Nuke git branch
function nukebranch () {
BRANCH=`git rev-parse --abbrev-ref HEAD`
if [ $BRANCH == 'master' ]; then
echo "Refusing to delete master"
else
(git push origin --delete $BRANCH || true) && git checkout master && git branch -d $BRANCH
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment