Posted on

Delete merged branches in git

git branch --merged <BRANCH> | grep -v "<BRANCH>" | xargs -n 1 git branch -D

git branch --merged | grep -v "master" | xargs -n 1 git branch -d

don’t forget about sudo

Leave a Reply

Your email address will not be published. Required fields are marked *