Skip to content

Instantly share code, notes, and snippets.

@larsxschneider
Created February 29, 2012 14:20
Show Gist options
  • Save larsxschneider/1941174 to your computer and use it in GitHub Desktop.
Save larsxschneider/1941174 to your computer and use it in GitHub Desktop.
Remove all merged branches on a Github
git fetch | git branch --merged | grep -v " master" | grep -v "* " | xargs -n 1 -I {} sh -c 'echo "Deleting" {}; git branch -d {}; git push --delete origin {}; git branch -dr {}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment