Skip to content

Instantly share code, notes, and snippets.

@tomanistor
Created September 20, 2021 16:48
Show Gist options
  • Save tomanistor/d2b74153fe137a2d0aee0074732163ca to your computer and use it in GitHub Desktop.
Save tomanistor/d2b74153fe137a2d0aee0074732163ca to your computer and use it in GitHub Desktop.
Git alias to prune all merged branches
alias git-prune='git branch --merged | grep -v "\*" | grep -Ev "(\*|production|master|staging|development)" | xargs -n 1 git branch -d'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment