have speculated that the song is a descendant of the Scottish border ballad "The Dowie Dens of Yarrow", while others have speculated it came from the German hymn "Ich bin ein Gast auf Erden" ("A Pilgrim Here I Wander").
[citation needed] The latter was translated and printed in many English hymnals throughout the 19th century.
[4] According to the book The Makers of the Sacred Harp, by David Warren Steel and Richard H. Hulan, the lyrics were published in 1858 in Joseph Bever's Christian Songster, which was a collection of popular hymns and spiritual songs of the time.
[5] During and for several years after the American Civil War, the lyrics were known as the Libby Prison Hymn.
[6] This was because the words had been inscribed by a dying Union soldier incarcerated in Libby Prison, a warehouse converted to a notorious Confederate prison in Richmond, Virginia known for its adverse conditions and high death rate.