SAN FRANCISCO — Jeff Samardzija retired the first six batters he faced Wednesday and did so with ease, but as rallies piled up in the bottom halves of innings, so did Samardzija’s time spent sitting on the bench. He lost some rhythm, left a few pitches up in the zone, and ended up getting knocked out in the sixth with five runs on his line. 

He didn’t mind one bit.

“If the reason your rhythm is messed up is that you’re hitting too much, those are some champagne problems,” Samardzija said. “You probably need to worry about something else.”

The Giants will have plenty to think about after a day off in New York, starting with how to get to the Mets trio of Steven Matz, Jacob deGrom and Noah Syndergaard. They couldn’t have vaulted into that tough series on a better note, having hammered the Padres 13-9 to clinch their first sweep of the year. 

The team that hit so many homers early on went back to a more trusted approach. Matt Duffy, who had three hits and a walk, looked around in the eighth inning as someone on the bench pointed out that the Giants didn’t have a homer while the Padres were on their way to losing with three of them. He shrugged. “That’s alright,” he said. This is how the Giants win anyway.

“We did a lot of things well at the plate today,” Duffy said. “Sac flies, two-out hits … again setting the table for Samardzija.”

[INSTANT REPLAY: Giants score season-high 13 runs, sweep Padres]

The starter had another RBI hit, giving him five runs driven in over his last two starts, a new career-high for an entire season. Duffy's bid day included a shift-beating triple to left that was one of three for the Giants. Brandon Belt also had a triple, along with a double, single and long sacrifice fly on a five-RBI day.

Belt and manager Bruce Bochy have a running joke where Bochy asks Belt what he’s going to do that day and Belt responds that he’s going to hit for the cycle. The first baseman said he would have to check with Bochy to see if the sac fly, a homer in some other parks, counts.

“I’m counting that,” he said. “In my head, I hit for the cycle today.”

Belt smiled and shook his head, continuing the theme of the series for the Giants. After starting the homestand with an ugly sweep at the hands of the Diamondbacks, they righted the ship and started having fun again. They’ve won five of six, getting back above .500 (12-11) before a tough road trip.

“We’ve had a pretty good run here (without an off day) and the guys have done a good job of bouncing back,” Bochy said. “It was a horrible start, to be honest, but the guys did a good job bouncing back and I thought it was critical that we bounce back.”

Bochy said he’s hopeful that the offensive outburst gives his hitters an extra jolt as they prepare to face some of the game’s best young arms, and in the clubhouse, hitters said it will. Belt noted that the lineup is just as good as the league’s top pitching staffs.

“I think for us, we knew we had it in there to score a lot of runs,” he said. “The offense just woke up.”

--- Trevor Brown was fine after taking a hard shot off the mask, but Bochy said Brandon Crawford was a little sore after a foul ball off the leg. Crawford was pulled late in the game but was walking fine and said he should be ready to go Friday night in New York. 

--- Samardzija has back-to-back multiple-RBI games. “A little broken-bat blooper at the right time can make you look good,” he said. Samardzija leads all pitchers with five RBI. It’s a long flight to New York ... think he brings that up to Madison Bumgarner a time or 20?

--- Matt Duffy was one of the first guests on my podcast (they’re all here, including the latest one with Derek Law!) and he talked then about the weird shift the Padres were putting on him in spring training. They’re still doing it, and Duffy took advantage with a liner to left that turned into a standup triple because there wasn’t a fielder within 100 feet of the ball. Duffy enjoyed that one.

“I’ve been trying to hit it there for three days,” he said.