And China’s decision late last year to require that most vehicles sold there be electric by 2035 is also critical because G.M. sells more cars in that country through its joint ventures than in the United States. And Britain, Ireland and the Netherlands have said they will ban sales of new gasoline and diesel cars starting in 2030.
G.M. has been talking about moving to zero-emissions vehicles for about two years. Last March, it unveiled modular battery technology that it said would lower costs. A few months later, G.M. said it could reach a point where electric vehicles cost no more than gasoline-powered ones more quickly than it had previously expected.
Ms. Barra was getting support and input from an unexpected source — the Environmental Defense Fund, which had criticized G.M. in the past. The chief executive had shared a barbecue dinner with the group’s president, Fred Krupp, at a conference in 2015, and by last fall they were in regular contact by phone and email.
“We both had an optimism we could reach common ground,” Mr. Krupp said.
In October, G.M. unveiled a Hummer electric pickup truck, and within a day it had collected enough orders to account for all the trucks G.M. planned to make in the truck’s first year.
“That was another inflection point,” Mr. Parker, the chief sustainability officer, said. “It showed consumers really are very excited about owning electric vehicles.”
Just a few weeks later, Mr. Biden became the president-elect. And by December, G.M. was meeting with his transition team, Mr. Parker said. “Our vision of a zero-emissions future aligns very well with their vision and their goals.”
At the same time, G.M. signed a pledge, known as the Business Ambition for 1.5 Degrees, to combat global warming. By early January, the company was homing in on 2035 as the likely date for the electric transition, Mr. Parker said. On Jan. 12, Ms. Barra appeared at the Consumer Electronics Show and detailed G.M.’s vision of a future with no tailpipe emissions, but gave no specific date.