Skip to content

Instantly share code, notes, and snippets.

@renechz
Last active December 16, 2015 23:39
Show Gist options
  • Save renechz/5515732 to your computer and use it in GitHub Desktop.
Save renechz/5515732 to your computer and use it in GitHub Desktop.
Delete all merged-to-master branches in git.
#!/bin/sh
# Setup.
# Add to directory in PATH (e.g. /usr/local/bin) and make it executable.
# $ chmod +x git-delete-merged-branches
git branch -d $( git branch --merged | grep -v '^\*' | grep -v 'master' )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment