This study empirically analyzes the impact of green credit policy implementation on the digital transformation of highly polluting enterprises by constructing a double difference model using observed data of A-share listed companies in Shanghai and Shenzhen in China from 2007-2021, and using the Green Credit Guidelines promulgated in 2012 as a quasi-natural experiment. It is found that: (1) the implementation of green credit policy inhibits the digital transformation of highly polluting enterprises; (2) financing constraints are an important mechanism by which green credit policy inhibits the digital transformation of enterprises; and (3) the inhibitory effect of green credit policy on the digital transformation of enterprises is more significant for state-owned enterprises and relatively weak for large-scale enterprises. The research in this paper helps to systematically and comprehensively understand the impact of green credit on the digital transformation of enterprises, scientifically assess the policy effects of green credit policies in China, and is important for understanding how green financial policies in China affect the transformation and development of highly polluting enterprises, and provides reference for the future green financial policy formulation of government departments.