Ich steh an deiner Krippen hier

"" (I stand by your manger here) is a German Christmas hymn, with lyrics by Paul Gerhardt which were first published in 1653. It was then sung with an older melody by Martin Luther, but a melody which was likely created by Johann Sebastian Bach for Georg Christian Schemelli's "Musicalisches Gesang-Buch" of 1736 is now part of current Protestant and Catholic hymnals.
History.
The Lutheran theologian and minister Paul Gerhardt wrote the text of 15 stanzas. It was first published in the fifth edition of Johann Crüger's hymnal "Praxis Pietatis Melica" in 1653. It was first a song of individual reflection and devotion, which became part of congregational singing only later, such as in 1709 in the hymnal "Geistliche und Liebliche Lieder" by Johann Porst.
In Germany, it is present in both the current Protestant ("Evangelisches Gesangbuch") and Catholic hymnals ("Gotteslob"). It is also part of several other hymnals and song books.
Text.
The text of the original stanzas 1, 3, 4 and 5 is given, as in the Protestant and Catholic hymnals: 
Tunes and settings.
Johannes Zahn listed eight hymn tunes which were specifically composed for "" and which originated or were first published between 1667 and 1883 (Zahn 4659–4666). One of these melodies, Zahn 4663, was first published as No. 195 in "Schemellis Gesangbuch" in 1736. 
Luther composed two hymn tunes for "Nun freut euch lieben Christen": the "Praxis Pietatis Melica" of 1653 specifies the second of these, the one that was published in the "Klugsches Gesangbuch", as melody for Gerhardt's text.
The hymn was published with the "Nun freut euch lieben Christen" tune in the "Gotteslob" of 1975. In the "Gotteslob" of 2013 it was published with the melody from "Schemellis Gesangbuch" as GL 256 in the common section, with . The older tune has been retained in regional sections, for example GL 758 in the "Gotteslob" of the Diocese of Limburg.
"Nun freut euch lieben Christen" melody.
The first print gives the melody of "Nun freut euch lieben Christen", a melody by Martin Luther which was also used for "Es ist gewisslich an der Zeit" (EG 149). This melody, Zahn 4429a, appears in older hymnals, and in the Epiphany part of Johann Sebastian Bach's "Christmas Oratorio", composed for the Christmas season of 1734–1735. Inserted in the narration of the Three Kings, the first stanza refers to them bringing gold, incense and myrrh, thus offering what the singer has to give, spirit and mind, heart, soul and courage ("mein Geist und Sinn, Herz, Seel und Mut").
Melody in "Schemellis Gesangbuch".
In 1736, Georg Christian Schemelli published in Leipzig a "Musicalisches Gesang-Buch" (Musical song book). Bach probably composed for this edition a melody in C minor which was intended for private devotion and solo singing. The Bach-Gesellschaft republished this setting of the song in 1892. The setting, known as , includes, apart from the hymn tune, a figured bass accompaniment.