The application of China's "Green Credit Guidelines" in 2012 is used in this article as a quasi-natural experiment, and panel data from Chinese listed firms from 2007 to 2021 is considered. To empirically examine the impact mechanism of green credit policy on company total factor productivity (TFP), the study uses a difference-in-differences model. It concludes that the green credit program significantly positively impacts corporate total factor productivity. Implementing the green credit policy can enhance corporate total factor productivity, and this conclusion holds after various identification assumption tests and robustness checks. The intrinsic mechanism indicates that corporate social responsibility and corporate R&D investment play an indirect role in the process of green credit policy affecting corporate total factor productivity, i.e., implementing green credit policy can improve corporate total factor productivity by promoting the fulfillment of social responsibility and increasing R&D investment. The heterogeneous effect shows that green credit policy has a significant effect on the total factor productivity of large-scale enterprises and state-owned enterprises. In contrast, its impact on TFP for small-scale and private enterprises is not significant.