Soon after the outbreak of the Civil War, he enlisted April 16, 1861 as a private in the 49th Pennsylvania Infantry and was mustered in as the regiment"s chaplain with the rank of captain. Earnshaw resigned his commission on October 12, 1862 when the regiment was consolidated with another regiment. He was appointed a hospital chaplain in the United States. Volunteers April 22, 1863 and remained in the service until August 27, 1867.
With the necessity of creating national cemeteries, Ernshaw was superintendent of the construction of Stones River National Cemetery and Nashville National Cemetery.
He was elected chaplain of the National Military Home in Dayton, Ohio on September 5, 1867 and held the post until illness forced him to retire. Earnshaw was Commander of the Ohio Department, Grand Army of the Republic in 1876, Junior Vice-Commander in 1877, and presided at the national encampment of the G.A.R. in Albany, New York in 1879, when he was elected to serve as the national organization"s 8th Commander-in-Chief.
He died July 7, 1885 in Dayton, Ohio and is buried there in Woodland Cemetery and Arboretum.