Finally, the Giants found a way to beat the Diamondbacks — and get their bats going, too.