Git branch - mounted using plumbing commands

Is there a way to achieve the equivalent of git branch --merged using git plumbing commands?

I know there are commands like git for-each-ref that give you commit hashes and their respective ref names. Is there a command to determine if a commit is available from another commit (which basically means --merged )?

+6
source share
1 answer

git merge-base --independent XYZ will tell you which ones are not merged with another branch yet.

In addition, git merge-base --is-ancestor XY will tell you if X is an ancestor of Y, but this is an inefficient way to implement git branch --merged because you need to run N ^ 2 times for N branches.

+2
source

All Articles