This melody first appeared in a manuscript copybook from 1780 to 1804 that was written by John Fife, a fiddler who was possibly from Perthshire, Scotland. He traveled at sea during the time in which he worked on this copybook, so the tune may also have originated from another area. Someone once communicated to me that the tune was about the 1917 Halifax explosion, although it clearly very much predates that event and I cannot now find any reference for this claim.
This jig probably dates from around 1780, and is one of the most popular and long-lived of traditional 6/8 tunes in history. It is also known by the colorful names Off She Goes for Butter and Cheese and Up She Got and Off She Went. It has been widely published and recorded.
This tune may have originally been collected from Abram Beamish as My Darling in Bed, but Chief Francis O'Neill later amended the title to avoid the suggestive connotations. But it was in vain; this tune is now sometimes called My Darling's a Sheep.