Skip to content

Instantly share code, notes, and snippets.

@polmuz
Forked from anonymous/delete-local-branches
Created March 11, 2015 18:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save polmuz/7df853b6ba5e468bdd7f to your computer and use it in GitHub Desktop.
Save polmuz/7df853b6ba5e468bdd7f to your computer and use it in GitHub Desktop.
git branch --merged origin/master | grep -v '\* master' | xargs -l1 git branch -d
git branch -r --merged origin/master | grep 'origin/.*' | cut -d / -f 2 | grep -v 'master' | xargs -l1 -I {} git push origin {} --delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment