James William Elliott collected the rhyme in his National Nursery Rhymes and Nursery Songs, published in 1870. It’s said that the melody is first associated with this version.