How to delete multiple local Git branches from Sourcetree?

I used to end up having so many local branches in sourcetree branches section which I no longer user. Here is a quick way by which you can delete multiple branches all at once.

Image for post
Image for post

One option is to right-click on each branch and delete them. But that is not easy if you have too many branches.

1. Click on your Repository and select Branch option.

2. Then click on Delete branches option and it will list all the branches both local and remote.

Just check all the branches that you want to delete and click on Delete Branches .

Note: Make sure you don’t delete any Remote branch which is important.

Using Command line:

To delete all local branches that are already merged into the currently checked out branch:

You can refer this Stackoverflow Post for more details on deleting branches via commandline.

If you enjoyed reading this post, please share and give some claps so others can find it 👏👏👏👏👏 !!!!

You can follow me on Medium for fresh articles. Also, connect with me on LinkedIn.

If you have any comment, question, or recommendation, feel free to post them in the comment section below!

Written by

iOS and tvOS developer, dreamer, photographer 🤨

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store