SAN FRANCISCO -- Hitting his first home run in a month gave Aaron Hill a sense of relief. Doing so in a victory made it even better.
"It felt good to put a run on the board," Hill said. "There are always going to be times when you will be struggling. It's good just to contribute."
Marco Scutaro went hitless in two at-bats with a walk in his season debut for the Giants, who were shut out for the fifth time in 13 games.
Miley (5-6) allowed four hits and won his second straight start for the first time since early April. He has given up three runs over his past 22 2/3 innings.
"I found it later in the game. They were hitting the ball hard but right at people," Miley said.
Ryan Vogelsong (5-7) gave up two runs and six hits in 6 1/3 innings.
"With two runs it shows you how good a job Wade did and also on the other side with Vogelsong," Hill said.
Vogelsong has lost his last four starts despite a 2.19 ERA over that span. The Giants have been shut out in each of his last three starts and given him no support in his last 24 2/3 innings.
"I'm sure he's frustrated," Giants manager Bruce Bochy said. "He had a quality start, good stuff. I wish we could have gotten him some runs. He really threw the ball well."
Scutaro, a postseason star for the Giants in their run to the 2012 championship, received a standing ovation when he came to the plate for his first at-bat of the season. He drew a walk.
Scutaro has missed the first half of the year because of a back problem.
Miley permitted one hitter -- Brandon Belt, who singled and walked twice -- to reach third base and that came with two outs in the seventh.
"I couldn't throw him a strike," Miley said. "I wish I didn't walk him."
Miley gave up one leadoff hit, and then promptly picked off Gregor Blanco in the fifth.
"That pickoff hurt," Bochy said. "We were trying to bunt him over to second, maybe put a little more pressure on the pitcher with some good hitters coming up. He has a good move and got him."
Hill homered with one out in the fourth. He hit a leadoff double in the seventh and Parra's RBI single ended Vogelsong's day.