To address the high‐carbon emissions from port equipment, one of the most effective measures is to replace diesel‐powered rubber‐tyred gantry cranes (RTGs) with electric‐powered alternatives. However, the oil‐to‐electricity retrofitting for diesel‐driven RTGs may negatively impact port operation efficiency. Moreover, port enterprises typically do not initiate the retrofitting without the low‐carbon policies. Therefore, this study focuses on the retrofitting of RTGs in combination with their deployment under the carbon emissions trading (CET) and government subsidy policies. An integer programming model is developed to help port enterprises determine the multistage planning of RTGs' retrofitting and deployment. Based on the block‐diagonal structure of the proposed model, a column generation method employing Dantzig–Wolfe decomposition is developed. The optimal integer solution of the model is then further refined using a branch‐and‐price approach. The Shanghai Yangshan Deep Water Port is used for numerical experiments. Numerical results demonstrate that the implementation of CET and government subsidy policies can reduce approximately 17,630 tons of carbon emissions and $8,751,861 operating costs in container terminal yard. Meanwhile, increasing government subsidies and carbon trading prices, and reducing free carbon emission quotas can encourage port enterprises to reduce more emissions.