History from Wikipedia
http://en.wikipedia.org/wiki/The_Battle_Hymn_of_the_Republic

The tune was written, circa 1855, by South Carolinian William Steffe. The lyrics at that time were alternately called "Canaan's Happy Shore" or "Brothers, Will You Meet Me?" and the song was sung as a campfire spiritual. The tune spread across the United States, taking on many sets of new lyrics.

A man from Vermont named Thomas Bishop joined the Massachusetts Infantry before the outbreak of war and wrote a popular set of lyrics, circa 1860, titled "John Brown's Body" which became one of his unit's walking songs. According to writer Irwin Silber (who has written a book about Civil War folksongs), the song was not about John Brown, the famed abolitionist, but a Scotsman of the same name who was a member of the 12th Massachusetts Regiment. An article by writer Mark Steyn explains that the men of John Brown's unit had made up a song poking fun at him, and sang it widely.

Bishop's battalion was dispatched to Washington, D.C. early in the Civil War, and Julia Ward Howe heard this song during a public review of the troops in Washington. As with many others, she assumed it was about John Brown the abolitionist. Her companion at the review, the Reverend James Clarke, suggested to Howe that she write new words for the fighting men's song, and the current version of "Battle Hymn of the Republic" was born [1].

Howe's "The Battle Hymn of the Republic" was first published on the front page of The Atlantic Monthly of February 1862. The sixth verse written by Howe, which is less commonly sung, was not published at that time.

 

Mine eyes have seen the glory of the coming of the Lord:
He is trampling out the vintage where the grapes of wrath are stored;
He hath loosed the fateful lightning of His terrible swift sword:
His truth is marching on.
(Chorus)
Glory, glory, hallelujah!
Glory, glory, hallelujah!
Glory, glory, hallelujah!
His truth is marching on.
I have seen Him in the watch-fires of a hundred circling camps,
They have builded Him an altar in the evening dews and damps;
I can read His righteous sentence by the dim and flaring lamps:
His day is marching on.
Chorus
I have read a fiery gospel writ in burnished rows of steel:
"As ye deal with my contemners, so with you my grace shall deal;
Let the Hero, born of woman, crush the serpent with His heel,
Since God is marching on."
Chorus
He has sounded forth the trumpet that shall never call retreat;
He is sifting out the hearts of men before His judgment-seat:
Oh, be swift, my soul, to answer Him! be jubilant, my feet!
Our God is marching on.
Chorus
In the beauty of the lilies Christ was born across the sea,
With a glory in His bosom that transfigures you and me:
As He died to make men holy, let us die to make men free,
While God is marching on.
Chorus