When a woman contributes her part to a conceived baby,
it is by way of her ovum which contains not the woman's entire DNA,
but only half of her DNA.
This half is made from her own two strands,
(Human DNA is diploid.)
and is composed of parts from
either her father or from her mother.

So Jesus did not have the entire DNA of Mary, only half.

(He couldn't, anyway, have her whole DNA because He was male and she was female---quite a difference.)

This video gives an excellent explanation of Jesus' DNA.

Click HERE to see.