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.
The Giants received minor league catcher Michael Papierski in the deal. Papierski was assigned to Triple-A Sacramento.
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.