Here's what I tell people when I perform this, and it's as near as I can figure... originating as a boatman's song in the 1830s or thereabouts, went out to sea as a shanty, came back to land as a ballad and has been sung as one for many years. It was popular with soldiers during the Civil War, and went out west with them afterwards and has enjoyed an incarnation as a cowboy ballad.Like MMario said, there's really no definitive answer, but this is the one I've been able to glean from the sources I've consulted.