For four years, from 1861 to 1865, my great-grandfather, William F. Irwin, fought for both the Union (5th Maine, Co. G) and the Confederate Armies (North Carolina, 8th Infantry). He wound up being captured by both sides, was imprisoned by both sides, and after taking the oath of allegiance to the United States and signing with his mark, enlisted in the U.S. Navy. He was, he said, a sailor.

He also married two sisters (one at a time) and had one son by each of them ... but that’s a story for another day.
Like my great-grandfather, Maine soldiers were quite at home on a rolling boat, but they were lost entirely on a “rocking” horse. The battles they fought far away from the Maine coast required equestrian skills they lacked. Pat Higgins at imaginemaine.com tells a good anecdote that illustrates what a problem horsemanship was for the Mainers:
George Prince, the company leader of the 1st Maine, was a sea captain first and foremost. When General Washburn reviewed the troops in Augusta, Maine, cavalryman Joe Gatchell wasn’t able to make his horse return to its position in the line. The other horses had “closed ranks.” Captain Prince was mortified and perhaps forgetting that he was not on the open ocean, called out, "Come up there! What in hell are you falling astern for?" Gatchell replied, "Why, captain, I can't get the damned thing in stays!" To which Prince replied, "Well, give her more headway, then!"
Here’s the oath of allegiance my great-grandfather took after his capture at Spottsylvania, Virginia. He was illiterate, so he signed with his mark (an X). Later, I'll post his reenlistment paper, which has beautifully formed (but very shaky) penmanship. It's clear that the officer who signed him up for another 3 years held his hand and had him sign his name, William F. Irwin. I wonder what kind of threat they used on that young Maine fisherman.