Skip to content

Instantly share code, notes, and snippets.

@cescoffier
Created August 18, 2015 06:58
Show Gist options
  • Save cescoffier/9ceacd1e422f89f6e186 to your computer and use it in GitHub Desktop.
Save cescoffier/9ceacd1e422f89f6e186 to your computer and use it in GitHub Desktop.
A function deleting all git branches that have been merged into the current branch
function cleanup-branches
git branch --merged | grep -v "\*" | grep -v master | grep -v dev | xargs -n 1 git branch -d
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment