This is one of a genre of songs glorifying the labouring man. Others are “All Jolly Fellow that Follow the Plough”, “We Shepherds are the best of Men”, etc. Such songs were popular with the labouring folk of England but less so outside of its borders. The earliest that this song can be dated to is the first half of the 19th century when it started to appear on broadsides. This song also has a sting in the tail, with verses about the changing face of agriculture, and a verse in the broadside which doesn’t seem to have made its way into the oral tradition states:
The railroads took away the trade
Which was bad enough before.
It made the fortune of two or three
And ruined many a score
But I’ll not be down-hearted
And join me in my song, etc
It is often sung in the folk revival to a tune recorded by the Watersons in the 60s.