Gestational diabetes mellitus (GDM) is a pregnancy complication in which women without previously diagnosed diabetes develop chronic hyperglycemia during gestation. The diet and lifestyle of the mother during pregnancy as well as lactation have long-term effects on the child’s health and development. Detection of early risk markers of adult-age chronic diseases that begin during prenatal life and the application of complex nutritional interventions at the right time may reduce the risk of these diseases. Newborns adapt to the ectopic environment by developing intestinal immune homeostasis. Adequate initial colonization of bacteria is necessary for sufficient development of intestinal immunity. The environmental determinant of adequate colonization is breast milk. Although a developing newborn is capable of producing an immune response, the effector immune component requires bacterial stimulation. Breast milk stimulates the proliferation of a well-balanced and diverse microbiota, which initially influences the switch from an intrauterine TH2 predominant to a TH1/TH2 balanced response and the activation of T-regulatory cells by breast milk-stimulated specific organisms (Bifidobacteria, Lactobacillus, and Bacteroides). Breastfeeding in newborns of mothers with diabetes mellitus regulates the adequate immune response of the newborn and prevents diseases of the neonatal and postnatal period.