From Stan Hugill's Shanties from the Seven Seas. The melody is Stephen Foster's "Camptown Races". Sailors taking “Forty-Niners” from the East Coast to San Francisco presumably heard this and adopted it as a chanty. It does not seem to have originally been sung to Foster’s tune. The texts are diverse (Hugill, for instance, has a version in which a sailor courts a girl and winds up with a venereal disease), but most seem to be related to the California gold rush. Burl Ives selected several inoffensive verses for inclusion in The Burl Ives Song Book.
I learned it from The Burl Ives Song Book.