Skip to content

Instantly share code, notes, and snippets.

Created December 13, 2012 14:36
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save anonymous/4276737 to your computer and use it in GitHub Desktop.
Save anonymous/4276737 to your computer and use it in GitHub Desktop.
Oneliners for deleting old merged branches
git branch --merged origin/master | grep -v '\* master' | xargs -l1 git branch -d
git branch -r --merged origin/master | grep 'pablo/.*' | cut -d / -f 2 | grep -v 'master' | xargs -l1 -I {} git push pablo :{}
@matagus
Copy link

matagus commented Jan 3, 2014

Another way is to install and use git-sweep ;)

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