Pit mud (PM), as an important source of microorganisms, is necessary for Chinese strong-flavor baijiu (CSFB) production. Although it has been revealed that the PM prokaryotic community diversities are influenced by its quality, product area, ages, etc., the characteristics and assembly process of the prokaryotic community in PMs across a pH gradient are still unclear. In this study, the regular changes of α- and β-diversities of the prokaryotic community across a pH gradient in PMs were revealed, which could be divided into "stable", "relatively stable", and "drastically changed" periods. A total of 27 phyla, 53 classes, and 381 genera were observed in all given samples, dominated by Firmicutes, Bacteroidetes, Proteobacteria, Lactobacillus, Caproiciproducens, Proteiniphilum, etc. Meanwhile, the complexity of the network structure of the prokaryotic microbial communities is significantly influenced by pH. The community assembly was jointly shaped by deterministic and stochastic processes, with stochastic process contributing more. This study was a specialized report on elucidating the characteristics and assembly of PM prokaryotic communities across a pH gradient, and revealed that the diversity and structure of PM prokaryotic communities could be predictable, to some degree, which could contribute to expanding our understanding of prokaryotic communities in PM.