Created
April 20, 2015 08:06
-
-
Save afroisalreadyinu/97b3e0d8baccc83d692d to your computer and use it in GitHub Desktop.
Nuke git branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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