SAN FRANCISCO (AP) -- Troy Tulowitzki doesn't want his Colorado teammates to start thinking about the playoffs just yet. But the Rockies' shortstop doesn't mind a little daydreaming every now and then.
"I think we learned a lot from last year," Tulowitzki said. "Just take it game by game and don't worry about how many games you're down. If we take care of business and keep on taking care of business every day, everything else will take care of itself."
Colorado is doing just that.
The Rockies, who stormed into the postseason in 2007 by winning 14 of their final 15 games, are trying to make a late push once again after stumbling through the first three months of the season. Colorado pulled within seven games of Arizona in the NL West with 29 games remaining, six of them against the Diamondbacks.
"It all comes down to execution," Rockies manager Clint Hurdle said. "We just did not execute well at home early and we didn't execute well on the road early. We've been on a nice little roll now."
Francis (4-8) was winless in his last five starts but maintained his recent domination of the Giants by allowing seven hits over seven innings and repeatedly pitching his way out of trouble after giving up two runs in the first inning.
The Rockies' left-hander, who has won his last four starts against San Francisco, worked out of bases-loaded jam with no outs in the third and benefited from a pair of double plays.
"It's a good feeling," Francis said. "I'm making better pitches now than I was before. I'm commanding my fastball a lot better and I'm able to stay ahead in a lot more counts."
Tulowitzki had two hits and an RBI, and Ian Stewart and Garrett Atkins had two hits each for Colorado, which won its third straight and is 23-14 since the All-Star break. Only the Brewers, Cubs and Devil Rays have been better during that stretch.
Randy Winn went 3-for-4 for San Francisco, which had its season-high five-game winning streak snapped. It was only the Giants' second loss in their last nine games against teams within their own division.
San Francisco starter Matt Cain (8-10) had not lost in his previous four starts but ran into trouble early when Torrealba homered in the second after Stewart's leadoff single. It was the second home run given up by Cain in his last two starts after the San Francisco righty had previously gone 13 straight outings without allowing one.
"Matt pitched fine," Giants manager Bruce Bochy said. "He made a mistake early in the game but overall he pitched a good ballgame. He pitched well enough to win but we just couldn't get enough runs for him."
The Rockies scored the go-ahead run when Omar Quintanilla drew a one-out walk off Cain in the fourth and scored on Tulowitzki's triple to right-center. Pinch-hitter Jeff Baker added an insurance run with a sacrifice fly in the eighth.
That was enough for Francis, who made the lead stand up for his first win since June 18. He was on the disabled list from July 2 to Aug. 6 because of inflammation in his left shoulder.
San Francisco was coming off a three-game sweep of San Diego and was within two games of the Rockies for third place in the NL West, but couldn't get much going after getting to Francis for two runs in the first.
The Giants loaded the bases with no outs in the third but failed to score when Francis got Aaron Rowand to hit into a force play at home before Bengie Molina grounded into an inning-ending double play. San Francisco also left a runner stranded at second in the fifth and sixth.
"Anytime you can dodge a situation like that I think some momentum can swing your way," Hurdle said. "Molina's been a tough out for us so you're always hoping you get a ball on the ground but it hasn't been the norm for us. Normally it's been in the gap so that was nice for us."
San Francisco pitches combined for seven strikeouts, giving them 1,005 for the season. It's the 12th time in franchise history the club has topped the 1,000 mark. ... San Francisco LHP Jonathan Sanchez felt fine one day after throwing on the side, a sign he could be ready to step up his rehab from a left shoulder sprain. ... Colorado RHP Matt Herges threw on the side without pain and is scheduled to do so again before going on a rehab assignment. Herges went on the DL with lower back stiffness on Aug. 20.