Alex Spence
Alex Spence

Reputation: 1538

Git - Find all descendant branches not merged in

We have a feature branch "feature" that has many descendant branches that are not merged in. I would like to find all of these branches so that we can make decisions to merge them in or not. We have a fairly large git repository and using git branch feature --no-merge shows us hundreds of branches that are not descendants of "feature".

I know that git does not track parent branches so this seems to be a difficult task and I was wondering if anyone has an easy way to find these.

Upvotes: 3

Views: 328

Answers (1)

torek
torek

Reputation: 490038

Get the complete list of branches with git branch --no-merged and filter against git branch --contains.

(I don't know if this works, but it's possible that git branch --no-merged X --contains X will do the trick without even requiring running comm or equivalent.)

Upvotes: 3

Related Questions