Skip to content

Instantly share code, notes, and snippets.

@oelmekki
Forked from tekkub/gist:1203061
Created September 8, 2011 13:48
Show Gist options
  • Save oelmekki/1203444 to your computer and use it in GitHub Desktop.
Save oelmekki/1203444 to your computer and use it in GitHub Desktop.
Git aliases to prune merged branches
[alias]
prunelocal = !sh -c 'git branch --merged | grep -v "^*" | xargs git branch -d'
pruneorigin = !sh -c 'git branch -r --merged | grep \"^ origin/\" | grep -v "/master$" | sed "s/origin./:/g" | xargs git push origin'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment