Say my Git repository has a branch master, BranchA, BranchBand BranchC.
Now all these branches have been merged into masters, possibly several times (for some reason, this is a hypothetical scenario). I want to find all the merge commands where BranchAit was merged into master.
This is how far I got to this question:
git log master ^BranchA --merges --oneline
This gives me all the commits that are in master, and not BranchA, which are also commits. This actually gives me all the commits I'm looking for, but it can also give me commits that I don't want, like merging with BranchBand BranchCin master.
Output Example:
10bdc8b Merge branch 'BranchA'
383693a Merge branch 'BranchB'
8af3b5c Merge branch 'master' of 192.168.0.0:/path/to/repo.git
aa0f22c Merge branch 'master' into BranchC
72bbf3a Merge branch 'BranchA'
fac1157 Merge branch 'BranchB'
, 10bdc8b 72bbf3a. grep "BranchA"; , , , , .
Edit
, , , , , . :
F <-BranchB
/ \
/ \
A-----B----C-----D--E----K----L <-master
\ / \ /
\ / \ /
G----H--------I---J <-BranchA
, BranchA . , , L D. , , , I, BranchA.
, branch --contains master, L, D B. , - master, BranchA, L. .
, git merge-base , L.
, , B D, BranchA. , , , Git, , .