KingArasan
KingArasan

Reputation: 733

Git hub - I need list of branches merged into master after particular commit

I need list of branches merged into master after particular commit

From master branch for a particular commit (A), I took branch X, Y & Z. I have merged back branch X & Y to master.

A--------------------------------------  master
|\                   /           /
| B-----C--- Branch X           /
|\                             / 
| -----D-----E-----F- Branch Y
|
| C--E--H--K      Branch Z

I need to get the list of branches merged into Master branch after the commit (A)?

I have tried with : git branch --all --merged origin/develop

but this gives the whole list and not from the particular commit (A).

Upvotes: 1

Views: 112

Answers (1)

elmart
elmart

Reputation: 2374

git branch --list --merged master

should give you the branches that are currently merged into master (their tips are reachable from master).

git branch --list --merged A

should give you the branches which were already merged at A

Subtract the second set to the first one and you get what you want. For example:

git branch --list --merged master | grep -v -f <(git branch --list --merged A)

That should do it.

Upvotes: 3

Related Questions