Anthony Daniel Chaidez, 25, of Riverbank was convicted March 5 of assault likely to cause great bodily injury.
Judge Marie Silveira sentenced him to four years in state prison.
Chaidez admitted having served two years in prison in 2006 for a residential burglary, which falls under California's "three-strikes" law.
On Dec. 14, during an argument at a Riverbank residence, Chaidez pulled out an extendable baton weapon and swung it at the victim's head. Chaidez missed hitting the victim by inches.
He then fled the scene and was found at his residence a couple of blocks away with the baton in his possession.