Skip to content

Instantly share code, notes, and snippets.

@MarcoSero
Last active August 29, 2015 14:06
Show Gist options
  • Save MarcoSero/2d3b60170bcc4142e303 to your computer and use it in GitHub Desktop.
Save MarcoSero/2d3b60170bcc4142e303 to your computer and use it in GitHub Desktop.
Cleanup merged branches
cleanup = "!git branch --merged | grep -v '\\*\\|master\\|develop' | xargs -n 1 git branch -d"
cleanupr = "!git fetch --prune ; git branch -r --merged | grep origin | grep -v '>' | grep -v '\\*\\|master\\|develop' | xargs -L1 | cut -d"/" -f2- | xargs git push origin --delete"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment