Molecular epidemiological assessments, drug treatment optimization, and development of immunological interventions all depend on understanding pathogen adaptation and genetic variation, which differ for specific pathogens. Mycobacterium tuberculosis is an exceptionally successful human pathogen, yet beyond knowledge that this bacterium has low overall genomic variation but acquires drug resistance mutations, little is known of the factors that drive its population genomic characteristics. Here, we compared the genetic diversity of the bacteria that established infection to the bacterial populations obtained from infected tissues during murine M. tuberculosis pulmonary infection and human disseminated M. bovis BCG infection. We found that new mutations accumulate during in vitro culture, but that in vivo, purifying selection against new mutations dominates, indicating that M. tuberculosis follows a dominant lineage model of evolution. Comparing bacterial populations passaged in T cell-deficient and immunocompetent mice, we found that the presence of T cells is associated with an increase in the diversity of the M. tuberculosis genome. Together, our findings put M. tuberculosis genetic evolution in a new perspective and clarify the impact of T cells on sequence diversity of M. tuberculosis.