Skip to content

Instantly share code, notes, and snippets.

@tschaub
Last active August 24, 2021 19:02
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 tschaub/515529a811e4a06e169c to your computer and use it in GitHub Desktop.
Save tschaub/515529a811e4a06e169c to your computer and use it in GitHub Desktop.
Prune all remotes and delete all branches that are already merged into the current branch
git config --global alias.tidy '!for r in `git remote`; do git remote prune $r; done && git branch --merged | grep -v "\*" | xargs -n 1 git branch -d'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment