Skip to content

Instantly share code, notes, and snippets.

@kennyp
Created February 7, 2013 16:15
Show Gist options
  • Save kennyp/4732014 to your computer and use it in GitHub Desktop.
Save kennyp/4732014 to your computer and use it in GitHub Desktop.
#!/usr/bin/bash
git remote prune origin
git branch | grep -v master$ | cut -d' ' -f3 | while read b; do echo "$b == $(git branch -r | grep $b)"; done | grep '== $' | cut -d' ' -f1 | xargs -n1 git branch -d
git gc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment