Skip to content

Instantly share code, notes, and snippets.

@ahoendgen
Last active September 6, 2021 16:23
Show Gist options
  • Save ahoendgen/6f6857f94adf16a215713a8376583e00 to your computer and use it in GitHub Desktop.
Save ahoendgen/6f6857f94adf16a215713a8376583e00 to your computer and use it in GitHub Desktop.
Git - Remove merged branches locally
git checkout main && git fetch --all --prune && 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