This song, often collected in anthologies of cowboy ballads and identified as traditional, was in fact written by Owen Wister for the 1904 stage adaptation of his novel The Virginian. Wister, a classically trained musician, had seriously considered becoming a composer before turning to literature as his profession.
As a sidelight to this, in 1893, on a ranch in West Texas, Wister had heard a cowboy singing “Get Along Little Dogies”, which really was a traditional cowboy song. Wister wrote down the words and annotated the tune, and later supplied these to Alan Lomax, who believed this to be the first documented record of the song.