This old folk song (probably) started out as a protest song against the harsh conditions under which black slaves worked during the mid-19th century while building out the US railroad system. Dinah was a slang term for a black woman (female slave) during the antebellum. Some minstrel shows played it sarcastically and with varying lyrics, and the song became a point of a cultural wrestling match between sides throughout the rest of the 19th and early 20th century.
This Vitaphone recording may have been the first ever made of the song. The song lyrics in this recording appear to be a blend of lyrics from various versions, probably to avoid taking sides so as to have a broader appeal.