Recently, the relationship between the goat host and its gastrointestinal microbiome has emerged as a hallmark of host-microbiota symbiosis, which was indispensable for the proper physiological function that convert the plant biomass to livestock products. However, little integrative information about the establishment of gastrointestinal microflora in goats exists. Herein, we characterized the colonizing process of the bacterial community in the digesta and mucosa of the rumen, cecum, and colon of the cashmere goat from birth to adulthood to compare its spatiotemporal difference via 16S rRNA gene sequencing. A total of 1,003 genera belonging to 43 phyla were identified. Principal coordinate analysis unveiled the similarity of microbial community between or within each age group increased and gradually developed toward mature whatever in digesta or mucosa. In the rumen, the composition of the bacterial community in digesta differed significantly from in mucosa across age groups; whereas in the hindgut, there was a high similarity of bacterial composition between the in digesta and mucosa in each age group before weaning, while the bacterial community structure differed markedly between these two types of samples after weaning. Taxonomic analysis indicated that 25 and 21 core genera coexisted in digesta and mucosa of the rumen and hindgut, respectively; but their abundances differed considerably by GIT region and/or age. In digesta, as goats aged, a lower abundance ofBacilluswas observed with higher abundances ofPrevotella 1andRikenellaceae RC9in the rumen; while in the hindgut, the generaEscherichia-Shigella,Variovorax, andStenotrophomonasdecreased andRuminococcaceae UCG-005,Ruminococcaceae UCG-010, andAlistipesincreased with age increased. In mucosa, the rumen showed microbial dynamics with increases ofButyrivibrio 2andPrevotellaceae UCG-001and decreases of unclassified_f_Pasteurellaceae; while the generaTreponema 2 and Ruminococcaceae UCG-010increased andEscherichia-Shigelladecreased in the hindgut as goats aged. These results shed light on the colonization process of microbiota in the rumen and hindgut, which mainly include the initial, transit, and mature phases. Furthermore, there is a significant difference in the microbial composition between in digesta and mucosa, and both these exhibit a considerable spatiotemporal specificity.