Skip to content

Instantly share code, notes, and snippets.

@dpmex4527
Forked from kylemacey/git-bomb.sh
Created April 11, 2017 22:47
Show Gist options
  • Save dpmex4527/651492833781bc706d4dca8fa7c45299 to your computer and use it in GitHub Desktop.
Save dpmex4527/651492833781bc706d4dca8fa7c45299 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)
mkdir -p ~/scripts/git
echo 'git branch --merged | grep -v "\*\|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