Skip to content

Instantly share code, notes, and snippets.

@danielweinmann
Last active June 1, 2022 03:12
Show Gist options
  • Save danielweinmann/0c9b6f04e3eac1edfe123e6f12ad4e83 to your computer and use it in GitHub Desktop.
Save danielweinmann/0c9b6f04e3eac1edfe123e6f12ad4e83 to your computer and use it in GitHub Desktop.
Add an alias to remove all topic branches that are already merged into master
git config --global alias.cleanb "! git checkout main && git branch --merged main | grep -v '^[ *]*main$' | xargs git branch -d"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment