Skip to content

Instantly share code, notes, and snippets.

@theophoric
Created September 11, 2015 00:10
Show Gist options
  • Save theophoric/51db820c839be3a79554 to your computer and use it in GitHub Desktop.
Save theophoric/51db820c839be3a79554 to your computer and use it in GitHub Desktop.
Delete git branches that have been merged with maser

Local

git branch --merged master | grep -v "\* master" | xargs -n 1 git branch -d

Remote

git branch -r --merged | grep -v master | sed 's/origin\//:/' | xargs -n 1 git push origin

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