With global warming, heat stress has become an important factor that seriously affects crop yield and quality. Therefore, understanding plant responses to heat stress is important for agricultural practice, but the molecular mechanism of high-temperature tolerance in garlic remains unclear. In this study, ‘Xusuan No. 6’ was used as the experimental material. After heat stress for 0 (CK), 2 and 24 h, transcriptome sequencing was used to screen metabolic pathways and differentially expressed genes (DEGs) closely related to heat stress and was further verified by quantitative real-time polymerase chain reaction (qRT-PCR). A total of 86,110 unigenes obtained from the raw transcriptome sequencing data were spliced. After 2 h of heat treatment, the expression levels of 8898 genes increased, and 3829 genes were decreased in leaves. After 24 h, the expression levels of 7167 genes were upregulated, and 3176 genes were downregulated. Gene Ontology enrichment analysis showed that DEGs were mainly enriched in seven categories: cellular processes, metabolic processes, binging, catalytic activity, cellular anatomical entity and protein-containing complex response to stimulus. Kyoto Encyclopedia of Genes and Genomes pathway enrichment showed that DEGs are involved in protein processing in the endoplasmic reticulum, plant hormone signal transduction, phenylpropanoid biosynthesis, and photosynthetic antenna proteins. Six genes were selected and further verified by qRT-PCR. In this study, the full-length transcriptome of garlic was constructed, and the regulatory genes related to the heat resistance of garlic were studied. Taken together, these findings can provide a theoretical basis for the cloning of heat resistance genes in garlic and for the analysis of heat resistance mechanisms.