Skip to content

Instantly share code, notes, and snippets.

@Zoramite
Created November 1, 2017 20:40
Show Gist options
  • Save Zoramite/453cd8dc800f8c9d02a0cccfb72a4a2f to your computer and use it in GitHub Desktop.
Save Zoramite/453cd8dc800f8c9d02a0cccfb72a4a2f to your computer and use it in GitHub Desktop.
Remove merged branches in git.
# Removes all the merged branches, ignoring master and staging branches.
git branch --merged | grep -vE '^\*|master$|staging$' | xargs -I % git branch -d %
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment