Skip to content

Instantly share code, notes, and snippets.

@peterjwest
Last active August 29, 2015 14:03
Show Gist options
  • Save peterjwest/cdb9ec06240b84f3a628 to your computer and use it in GitHub Desktop.
Save peterjwest/cdb9ec06240b84f3a628 to your computer and use it in GitHub Desktop.
Delete merged branches
# Removes deleted branches on remote, locally deletes all merged branches which are not the current branch or master or develop
git checkout develop && git fetch --prune && git branch --merged | grep -E -v "^((\* )|\s*(develop|master)$)" | xargs git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment