Skip to content

Instantly share code, notes, and snippets.

@steveosoule
Created February 15, 2022 19:08
Show Gist options
  • Select an option

  • Save steveosoule/0bb3d90940530d06249a070a13d8d0c0 to your computer and use it in GitHub Desktop.

Select an option

Save steveosoule/0bb3d90940530d06249a070a13d8d0c0 to your computer and use it in GitHub Desktop.
git-prune alias
# Delete all of the local and remote branches (except master, main, develop) that have been merged into the current branch
alias git-prune='git fetch --prune && git pull && git branch --merged | egrep -v "(^\*|master|main|develop)" | xargs git branch -d'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment