How to deleted all branches merged into the current branch

The following command deletes all the branches(except for master and develop branches) that are already merged into the currently 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...