Skip to content

Instantly share code, notes, and snippets.

@katylava
Last active August 29, 2015 13:59
Show Gist options
  • Save katylava/10907671 to your computer and use it in GitHub Desktop.
Save katylava/10907671 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
git remote prune origin;
for b in `git br --merged master | grep -v "^\s\+master$" | grep -v "^\*"`; do
git br -d $b;
done;
# gist git-cleanup -u 10907671
@yobert
Copy link

yobert commented Jul 3, 2014

So awesome. And shouldn't this work with remote branches too with git br -v, and git push :$b? Heh I guess that's a little scary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment