Matt Duffy hit an RBI triple and Ehire Adrianza had two hits and an RBI for the Giants, who had won once in their previous 10 games.
Archie Bradley allowed two runs and six hits over three innings for the Diamondbacks. He struck out two and did not walk a batter.
Ex-Giant Cody Ross and Yasmany Tomas each had two hits for Arizona.
Brandon Crawford, who played shortstop for the third time this spring, had a hit and scored a run. Juan Perez added two hits, including a double.
Hudson went 1 1-3 innings and allowed five batters to reach base. He was helped in the first when center fielder Gary Brown threw out a runner at the plate.
Curtis Partch got the final two outs of the second, leaving the bases loaded.
Diamondbacks: Bradley said he felt better than he has in a long time. Arizona's top prospect was dealing with an elbow issue for most of last season. "With what I went through last year, you know, I never lacked confidence, but you lose some of that. You're seeing me get that back.''
Bradley said he had his best fastball command of the spring, though he didn't have command of his curveball until the third inning. "That's the best I've felt on the mound in a long time,'' he said. "The way I kept things under control, it was a positive thing.''
Giants: Hudson, who did not throw a bullpen session between starts, said all he needs is mound time. He's not worrying about results. "I need to work on release-point stuff, mechanical stuff,'' he said. "The plate is moving around on me, but that will get better. From a workload standpoint I'm ahead of where I thought I might be. I didn't think I would be out this early, but I am. You can't look at numbers and say too much. The World Series MVP (teammate Madison Bumgarner) has given up a run this spring.''
Diamondbacks: Arizona released OF Ben Francisco and reassigned RHP Blake Beaven, RHP Aaron Blair, RHP Justin Marks, C Matt Pognozzi, RHP Braden Shipley and C Mark Thomas to minor league camp. LHPs Vidal Nuno and Andrew Chafin are no longer being considered for the starting rotation but remain in the bullpen mix.
Giants: San Francisco is moving OF Norichika Aoki to left field and will use Gregor Blanco or Juan Perez in right until Hunter Pence returns from injury.
Diamondbacks: RHP Addison Reed (shoulder soreness) continues to throw bullpen sessions as he works himself into condition to open the season on time.
Giants: RHP Tim Lincecum (neck) will miss his next scheduled start and will pitch on March 21. He has played catch in two of the last three days. ``I can't force the issue,'' he said. ``It's not the time to be a hero and try to power through it.'' ... Pence (broken right forearm) had his cast replaced. He will wear one for a month.
Diamondbacks: RHP Randall Delgado starts Monday against the Chicago White Sox.
Giants: RHP Chris Stratton starts Monday against Cincinnati. San Francisco reliever Sergio Romo is also expected to make his spring debut.