0

I'm not as tidy with my git branches as I could be. One way to clean up branches (described here) is:

git checkout master
git branch --merged # get those branches are merged
git branch -d $branch

But that only works for master. Is there an easy way to do this for all branches. One approach would be to loop over the branches, but that's starting to feel overcomplicated.

Att Righ
  • 1,439
  • 1
  • 16
  • 29
  • 4
    `--merged` can take an argument : `--merged branch-foo`. So you don't have to switch to each individual branch to see which branches are merged into them. Is that what you are looking for ? – LeGEC Oct 04 '22 at 11:17
  • Looping overt branches is not actually complicated, bash supports writing loops quite easily. – joanis Oct 04 '22 at 13:39

0 Answers0