Skip to content

Instantly share code, notes, and snippets.

@glektarssza
Last active December 15, 2023 15:42
Show Gist options
  • Save glektarssza/672529a76deb7a58566fd8d2eb04cd66 to your computer and use it in GitHub Desktop.
Save glektarssza/672529a76deb7a58566fd8d2eb04cd66 to your computer and use it in GitHub Desktop.
One-line Cleanup Merged Git Branches
git remote prune origin && git branch --merged | sed -rne '/(^\*|main$)/d;p' | xargs -n1 git branch -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment