Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonhilgart22/ce59da0a5996d70ffc73fd8c40b2662d to your computer and use it in GitHub Desktop.
Save jonhilgart22/ce59da0a5996d70ffc73fd8c40b2662d to your computer and use it in GitHub Desktop.
# Delete branches that have been merged
function cleanup-branches {
git checkout master;comm -12 <(git branch | sed "s/ *//g") <(git remote prune origin --dry-run | sed "s/^.*origin\///g") |xargs git branch -D
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment