SAN FRANCISCO — Buster Posey's 1,000th hit came on a home run that bounced off the top of the wall and over. The fan who grabbed the souvenir ball gladly returned it, and Posey offered a bat in trade.

That kind of good fortune is exactly what the San Francisco Giants need this final week as they make a playoff push — and more of the same kind of offensive production from up and down the lineup.

Hunter Pence went deep one batter after Posey in the fifth inning during a 19-hit night for San Francisco, and the Giants beat the Colorado Rockies 12-3 on Tuesday.

"It's a cool accomplishment," Posey said. "I think back of being a kid and thinking about, the opportunity to play in the major leagues was a dream come true, so to have 1,000 hits is kind of hard to believe."

Brandon Crawford tripled twice for San Francisco, which remained a half-game behind the Mets for the top NL wild card and one game up on the Cardinals for the second spot.

Matt Moore (12-12) matched his career high with 11 strikeouts over 7 2/3 innings, rebounding from his worst start this season.

Posey and Pence hit consecutive solo shots, the fifth time the Giants have had back-to-back homers this year. Each player drove in two runs on the night. Conor Gillaspie added a two-run homer in the eighth.

Crawford had two triples in a game for the first time — one driving in two runs in the eighth — among his four hits. Brandon Belt tripled, doubled, hit an RBI single and scored two runs for the Giants after manager Bruce Bochy called on his team to get going offensively for this crucial, final week.

Not so much different than the Giants' challenges down the stretch in their World Series-winning years of 2010, '12 and '14.

"It's fun," Bochy said. "It really is. We wish we were in better position."

Joe Panik had a triple, an RBI double and a single. Angel Pagan added two hits, including a run-scoring single, and an RBI groundout.

All three NL wild-card contenders won by scoring 12 runs. In fact, Bochy told hitting coach Hensley Meulens he'd better have his hitters ready.

"Hopefully, this gets this offence clicking a little bit," Bochy said. "We're going to have to score runs. We're playing good teams and they swing the bat. It will be important we get this offence going a little bit. That's gotten away from us. That's my hope, it is something they can build on."

Moore was knocked out after only an inning — the second-shortest start of the lefty's career — in a 9-3 loss at the Dodgers last Wednesday, allowing six runs on seven hits. He gave up six hits and one run Tuesday and didn't walk a batter.

"The ball jumps on you," Rockies manager Walt Weiss said. "He commanded his stuff well."

The Giants acquired infielder Gordon Beckham from Atlanta earlier Tuesday and he showed up in San Francisco's dugout making introductions early in the game. Partially blocking Posey's spot postgame in a neighbouring locker, Beckham joked to the catcher he was doing an important interview.

Colorado got Charlie Blackmon's RBI groundout in the third but lost its eighth straight road game.

Rockies rookie right-hander German Marquez (1-1) allowed 12 hits and six runs over 4 1/3 innings in his second career start after beating St. Louis in his first one.

REMEMBERING FERNANDEZ

A moment of silence was held for Miami Marlins pitcher Jose Fernandez, who died early Sunday in a boating accident. A No. 16 Fernandez Giants jersey hung in the dugout.

TRAINER'S ROOM

Rockies: Mark Reynolds is not on the club's final three-game trip to the Bay Area. He broke his left hand after being hit by a pitch against San Diego on Sept. 18, ending his season.

Giants: INF Eduardo Nunez had an MRI that showed a mild right hamstring pull that is expected to keep him out a few days, the reason Beckham was added. Nunez could be ready by the weekend series against the Dodgers. ... RHP Johnny Cueto threw a bullpen — Bochy even stood in as the hitter for a few minutes — to test his strained left groin and did fine. Cueto is slated to start Thursday as planned without restrictions. He will go through some fielding work Wednesday to make sure the groin is fine. ... OF Mac Williamson was placed on the 60-day disabled list with a quadriceps strain that was unknown to the team until he could barely walk after landing from San Diego on Sunday night.

ROSTER MOVES

San Francisco sent Class-A infielder Rich Rodriguez to Atlanta. ... The Giants added C Tony Sanchez to the roster for insurance behind Posey and Trevor Brown. ... LHP Matt Reynolds was designated for assignment.

UP NEXT

Rockies: RHP Tyler Chatwood (11-9, 4.08 ERA) is 7-1 with a 1.88 ERA in 12 road starts this season. He's 2-1 with a 2.77 ERA in five career outings at AT&T Park.

Giants: RHP Jeff Samardzija (12-10, 3.83) is 1-1 with a 2.38 ERA in three starts this season against the Rockies, going at least seven innings in each one and striking out nine Colorado batters in the past two.