Joe Girardi’s managing career was moments away from taking a drastic turn.

Former Dodgers general manager Ned Colletti joined Jon Heyman and Rob Bradford on the “Big Time Baseball” podcast on Monday and revealed that Girardi, who managed the Yankees from 2008-2017 and the Marlins in 2006, nearly landed in Los Angeles in 2007.

An agreement was nearly reached before the Yankees fired Joe Torre after their postseason exit. It quickly became clear Girardi, who won three World Series with the Yankees as a player, had set his eyes on the Bronx.

“We had contract discussions on term and rate,” Colletti said. “Just as we were coming down to kind of finishing it off, at least in my mind, he [Girardi] had come out here to visit, he was doing network analyst work during the postseason, so he was in L.A. He had a chance to meet ownership.

“As soon as we got to that level, Joe Torre left the Yankees,” Colletti said. “The minute Joe Torre left the Yankees, I called Joe [Girardi], I knew Joe very well, and I said, ‘Hey, they’re gonna come after you for that Yankee job. He says, ‘You think?’ I said ‘Yeah, I can pretty much guarantee that Cash [Brian Cashman] is gonna call you.’ And I said, ‘So you’ve got to tell me where your heart’s at.’”

Girardi took the Yankees job and Colletti quickly pivoted to Torre, who ended up managing the Dodgers for three seasons.

Colletti and Girardi’s relationship formed during Girardi’s playing days, when the former catcher was drafted by the Cubs in 1986. Colletti, who worked in the Cubs’ baseball operations department, took notice of Girardi’s leadership abilities.

Girardi’s time in charge of the Yankees quickly turned fruitful. The club won its 27th championship two years into his tenure. Girardi lasted a decade at the Yankee helm, ultimately getting fired after New York’s 2017 ALCS loss to the eventual champion Astros.

Girardi also chatted on the podcast, expressing his displeasure with his pinstripe departure.

“I was shocked and I was disappointed and I let that be known two years ago,” Girardi said. “I was excited about the direction the Yankees were moving in. For the three to four years previous to that, we were an aging group that struggled with injuries and the performance of some of the veteran guys that we had was not what they had done in the past. A lot of that had to do with age, so I was excited about the prospects of the team that was coming back in 2018.”

The Yankees decided to move on to a younger skipper, hiring Aaron Boone for his first managerial gig. After two seasons on the sidelines, and amid rumblings of Mets interest should they fire Mickey Callaway, Girardi wants to get back in the dugout.

“I don’t really have a particular team that I’m looking at,” Girardi said. “I’m not looking at a particular situation. I’ve been through a lot of different situations. I’ve been with rebuilds in Miami and somewhat of a rebuild in New York. I’ve been with young players and I’ve enjoyed that immensely. I’ve been with older players and I’ve enjoyed that immensely.”