It's an American folk song of unknown origin. The words were first printed in 1852 but to a different tune, one of many before the current melody.

The familiar tune first appeared in the The Franklin Square Song Collection, published 1881 by J. P. McCaskey. The song is credited to Eliphalet Oram Lyte who probably composed it. You'll find it in Vol. 1 on pg 69.
https://catalog.hathitrust.org/Record/100833959

Lyte (1842–1913) was a school principal best known for his grammar books for use in the classroom but was also a prolific composer.

Collecting 19th C. American folk and popular music is one of my hobbies.


BIAB 2024 Audiophile Mac
24Core/60CoreGPU M2 MacStudioUltra/8TB/192GB Sequoia, M1 MBAir, 2012 MBP
Digital Performer11, LogicPro, Finale27/Dorico/Encore/SmartScorePro64/Notion6 /Overture5