Last active
August 24, 2021 15:42
-
-
Save kylemacey/8978205 to your computer and use it in GitHub Desktop.
This gist will create a custom git script that will delete any branches that are fully merged into the currently checked out branch (usually run on master)
This file contains 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
mkdir -p ~/scripts/git | |
echo 'git branch --merged | grep -wiv -e "main" -e "master" | xargs -n 1 git branch -d' > ~/scripts/git/git-bomb | |
echo 'git remote prune origin' >> ~/scripts/git/git-bomb | |
chmod +x ~/scripts/git/git-bomb | |
sudo ln -s ~/scripts/git/git-bomb /usr/bin/git-bomb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
don't delete master ->
'git branch --merged | grep -v "\*\|master" | xargs -n 1 git branch -d'