SAN FRANCISCO (AP) Gorkys Hernandez is hitting for power, grinding through long at-bats and moving baserunners with timely bunts - and his teammates are taking notice.

Hernandez drew a go-ahead, bases-loaded walk in the eighth inning after his earlier solo home run, and the San Francisco Giants beat the Colorado Rockies 3-2 on Tuesday night.

"We're going to be talking about him for a while," Giants starter Derek Holland said of Hernandez. "He's been doing outstanding this year, he's been a huge part of this team."

Tom Murphy doubled to start the ninth for the Rockies on a hit that sliding Hernandez couldn't secure in center field, and the ball kicked back toward the infield. San Francisco left third base uncovered, but despite base coach Stu Cole wildly gesturing, Murphy never looked up and stopped at second. DJ LeMahieu wound up grounding into a game-ending double play that was confirmed on replay.

"There's a lot of chaos going on at that point. Rarely do you see that type of situation occur where you have three guys covering second base," Rockies manager Bud Black said. "Pitcher, third baseman, first baseman end up going over there."

Tony Watson (2-2) recorded the final out of the eighth before Sam Dyson closed out Colorado for his third save.

The Giants loaded the bases in the eighth against Adam Ottavino (3-1), whose scoreless streak ended at 15 innings with his first run allowed since May 8 at home against the Angels.

Austin Slater and pinch-hitter Hunter Pence had consecutive singles to start the seventh before advancing on a sacrifice bunt by Hernandez, who homered to tie it in the third. Rockies starter Chad Bettis intentionally walked Buster Posey to load the bases for McCutchen, and Ottavino relieved and gave up the go-ahead run. Slater just beat center fielder Gerardo Parra's throw to the plate.

Bettis gave up two runs and six hits in a 6 1/3 innings, struck out four and walked four.

He had allowed five or more runs in his previous five starts but hadn't lost, a streak that is tied for the longest in major league history with Rube Walberg from June 1-18, 1932. All of Bettis' decisions have come away from Coors Field.

Desmond hit a one-out solo homer in the second to put Colorado ahead before Hernandez tied it.

Four of Hernandez's 10 home runs have come against the Rockies. His previous career high was three, and he didn't hit any last year.

"It feels great, last year having nothing (homers) to this year having 10," he said.

Following the Giants' first day off since June 7, Brandon Crawford had three hits and scored the deciding run on the walk by Hernandez after a one-out single and steal of second.

San Francisco improved to 6-2 on its current homestand.

"We've been playing better," manager Bruce Bochy said. "Hopefully we can build on this, and we're going to have to."

Holland matched his season high with eight strikeouts while pitching a season-long 6 2/3 innings. Looking to win back-to-back outings for the first time in 2018, the lefty settled for a no-decision. He allowed six hits, the one earned run and walked two.

Three intentional walks by Colorado pitchers were the team's most since three on June 24, 2016, against Arizona.

TRAINER'S ROOM

Rockies: LHP Mike Dunn (upper back strain) and RHP Scott Oberg (back strain) each responded well from rehab outings with Class A Modesto - both pitchers struck out two with a walk in a scoreless inning - and were set to play catch Tuesday. "They're healthy," Black said. "I think they've checked off a couple boxes health-wise. We have some decisions to make."

Giants: RHP Jeff Samardzija was tagged for five runs in the first inning and six in all of his rehab start for Triple-A Sacramento at Albuquerque as he works back from tightness in his pitching shoulder. Samardzija allowed seven hits in four innings with six strikeouts, two walks and a pair of home runs. ... RHP Johnny Cueto (right elbow sprain) is set to pitch for Sacramento on Friday, throwing up to 70 pitches. ... 3B Evan Longoria is underway with his initial rehab work following surgery for a fractured left hand. There is still no timeline change from the initial indication of six to eight weeks, Bochy said.

UP NEXT

Rockies: LHP Kyle Freeland (7-6, 3.55 ERA) makes his 10th road start out of 16 2018 outings and is 2-0 with a 3.00 ERA in two appearances against the Giants this year.

Giants: LHP Madison Bumgarner (1-2, 3.20) makes his fifth start of 2018 needing one strikeout for No. 1,500 of his career - and playing in his 239th career game would become the fourth-fastest lefty to accomplish the feat in the live-ball era, according to STATS.