Gettysburg was more or less an accident (the location I should specify- obviously a major battle was bound to happen somewhere twixt there and D.C.). Confederate troops entered the city looking for shoes and encountered the Union troops; neither army had any idea how close they were to the other until then and consequently neither had fortified any positions for control of water or railroads or constructed any other any other battlefield preparation and infrastructure*. Taking or holding the town wasn’t either side’s real objective, whereas with Atlanta and Chattanooga and Harper’s Ferry and other battles that were called the same thing by both sides the name of the place was very much the objective of both sides.
In some places water and town had the same name- Chickamauga for instance is the name of the stream and the town (said to mean “river of death” though to quote Shelby Foote ‘God knows what the hell it really means’). The fighting was far more over the water and in fact a moment of that battle emphasizes how important water was: one Union cavalry regiment and some infantry were forced to surrender because of dehydration when they were cut off from water by Forrest and blocked from retreat by terrain and troop movements behind whose identity they weren’t certain about*. While it had nothing to do with the ultimate Southern victory (that being Longstreet filling the gap through backassward luck of timing) it reminds that while “an army travels on its stomach” in the best of times it don’t travel at all when the bladder’s empty.
*Two of the things you don’t think about but were done on the eve of every battle as much as possible were the digging of latrines. It may sound trivial, but it certainly wasn’t if you lived there: tens of thousands of men put out a LOT of doo-doo, and you want to control it as much as possible. (Even in peacetime some places actually failed when the amount of sewage in a small place [such as 200 free people and slaves on a plantation or 5,000 in a small city] was so large that it soaked into the water supply, and while these people didn’t know about the germ theory of disease they knew that an enormous amount of waste caused disease [miasma and all that].)
In addition to latrines, when there was relative certainty a major battle was imminent- sieges for instance- details also set to work digging graves before the first shot was ever fired so that they could get as many people into the ground as soon as possible after the battle. There are reports of gravediggers working on both sides at Chattanooga for several days before the major battles began in late November.
None were dug before the battle at Gettysburg and with the southern retreat cleanup was by all accounts a bitch. When Lincoln gave the G’burg Address that fall there were still horse remains on the battlefields and human remains were still being found as the foliage fell. (If you want to imagine what Hell must smell like, think of how the town of Gettysburg and its outlying areas for many miles must have smelled on July 4 when there was rotting flesh everywhere [not just the bodies but the amputated limbs, dead horses, etc.] and the gunpowder lingering and the excrement and urine left behind by 200,000 soldiers and camp followers and their horses and mules over the course of 3 days in July.)
**One of the things you don’t often think about regarding battles at this time is that most hostilities stopped at night time for the simple reason that the armies couldn’t see who or what they were shooting at; this was the case at both Gettysburg and Chickamauga- furious hostilities and men falling dead in piles on both sides and then almost like a ‘quitting time’ whistle and both retire to camps until the next morning. Many Union and Confederate soldiers were killed by friendly fire.