Do you use SourceTree to help manage your Git repos? Ever work on a bunch of pull requests and have a lot of local branches you need to delete? I found a way to delete multiple branches at one time.
- Click Repository then click Branch.
- Click Delete Branches.
- Select the branch(es) you want to delete. Be sure not to select other than Local branches unless that’s your intention.
Lance Willett
If you ever need a similar action in a command line environment, here’s what I use:
`git branch –merged | grep -v “\*” | xargs -n 1 git branch -d`
It removes local branches that have been deleted in the remote repository.
Dan
I use this too! Very handy
hellomihai
awesome! been looking for this for a while! thanks.
Amar
Very helpful. Thank you for sharing.