The San Francisco Giants have agreed to a one-year, $4.8 million contract with Casey McGehee.

The pact avoids salary arbitration.

San Francisco acquired the 32-year-old from the Miami Marlins in December to replace Pablo Sandoval, who left as a free agent and signed with Boston.