The 27-year-old Dubón is batting .239 with two homers and eight RBIs in 21 games this season. He has big league experience at second base, third base, shortstop and center field.
"He really came together as a man, as a teammate, and as a baseball player,'' Giants manager Gabe Kapler said. "This is a great opportunity for him.''
The Giants received minor league catcher Michael Papierski in the deal. Papierski was assigned to Triple-A Sacramento.
"It's always nice to have a switch-hitter and a guy that's more difficult to match up against," Kapler said about Papierski. "As aggressive as we are in using our bench, it's always nice to have, potentially at some point, a guy that you may be able to kind of let ride, particularly at the catcher position.''
San Francisco also recalled infielder Donovan Walton from Sacramento before the Giants' game at St. Louis.
Dubón made his big league debut in 2019 with Milwaukee. He is a .258 hitter with 15 homers and 58 RBIs in 179 games in the majors.
The Astros had won 11 straight games heading into Saturday's matchup with Washington.