Barnhart went 1-for-3 with a double and a run scored in Wednesday's 5-3 loss to the Cubs.
The Diamondbacks selected Barnhart's contract Monday.
Barnhart signed a minor-league contract with the Diamondbacks on Tuesday and received an invitation to major-league spring training.
Barnhart agreed to a minor-league contract with the Dodgers on Wednesday, Robert Murray of FanSided.com reports.
The Cubs released Barnhart on Sunday.
The Cubs designated Barnhart for assignment Saturday, Andy Martinez of Marquee Sports Network reports.
Barnhart is starting at catcher and batting ninth in Sunday's game against the Yankees.
Barnhart remains out of the lineup for Monday's game against the Astros.
Barnhart is out of the lineup for Sunday's game against the Marlins, Jordan Bastian of MLB.com reports.
Barnhart is out of the lineup for Friday's game against the Marlins.