How to deleted all branches merged into the current branch

The fol­low­ing com­mand deletes all the branches(except for mas­ter and develop branches) that are already merged into the cur­rently checked out branch

git branch --merged | grep -v "(^*|master|develop)" | xargs git branch -d

If you just want to see all the merged branches, you can run the following

git branch --merged

Ryan Sukale

Ryan is just a regular guy next door trying to manage his life and finances.

You may also like...