Texas will send minor leaguers to the Brewers.
Gallardo was 8-11 last year with a 3.51 ERA and 89-64 with a 3.69 ERA in an eight-year career with Milwaukee.
His contract specifies his 2015 salary increases from $13 million to $14 million if he's traded. Gallardo is eligible for free agency in November.
Yahoo! first reported the deal.
Gallardo's departure presumably frees up a spot for young right-hander Jimmy Nelson to join Kyle Lohse, Matt Garza, Wily Peralta and Mike Fiers in the Brewers' rotation.
Right-hander James Shields remains available in the free-agent market if the Brewers decide to pursue pitching for the second straight offseason. Milwaukee added Garza before the 2014 season.Milwaukee went 82-80 last year and missed the playoffs after letting a big NL Central lead slip away in September.