Where did the soldiers get there shoes for the civil war?

Many of them got none.

The location of the Battle of Gettysburg had a lot to do with a nearby boot-and-shoe factory that the Confederates wanted to raid, to equip their men.

By the time of Appomattox, most of Lee's men were barefoot (and starving).

It is a curiosity that a pair of Civil War boots did not have a left and a right. They were identical, and you walked them into shape.