In git is there a way to find out redundant branches which are already in the commit history of a particular/current branch ? So that I can delete those redundant branches without loosing any commits and clean my repository as well ?
It turns out to be pretty easy, to get list of all branches merged to master just call:
git branch --merged master
Then you might do following to remove them (use with care):
git branch --merged master | grep -v "\* master" | xargs -n 1 git branch -d
I found this solution here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With