git branch --merged | grep -v '^*\|main\|master\|develop' | xargs -r git branch -d This may not work on other merging strategies squash/rebase.
git branch --merged | grep -v '^*\|main\|master\|develop' | xargs -r git branch -d This may not work on other merging strategies squash/rebase.