This is a previous answer that covers the civilian population of towns during the American Civil War as a whole and (very) briefly touches upon Gettysburg. Answers are by u/petite-acorn and u/bodark43