In taking his army north from the Rappahannock, General Lee's objective was to induce the Union Army to disperse across a broad front along the Mason-Dixon line, and then, by maneuver, draw it to a point far from its base of supply where it could be attacked and beaten in detail. In the execution of this operation, the three corps of the Rebel army marched from the vicinity of Culpeper Courthouse into the Shenandoah Valley and across the Potomac at Williamsport and Sheperdstown. Once in the Cumberland Valley, Ewell's corps, leading the invasion, marched to Chambersburg, Pennsylvania. There, CSA General Jubal Early's division turned east and, passing through the South Mountain at the Cashtown Gap, marched past Gettysburg to York while General Ewell, with Rodes's and Johnson's divisions, marched to Carlisle, sending one brigade forward to the Susquehanna in front of Harrisburg. Confederate General A.P. Hill's corps, and General Longstreet's, followed Ewell as far as Chambersburg, arriving there, on June 27, and went into camp.
On June 25, when it became clear to its commander, General Joseph Hooker US, that the enemy was crossing the Potomac west of the Blue Ridge, the Union army, scattered about the Manassas plain, marched to Leesburg and crossed the river at Edward's Ferry, moving west to Frederick, Maryland, and into the Middletown Valley to block the anticipated movement of the enemy east through Turner's Gap. Two days later, realizing from reports received that the enemy had reached the Susquehanna River at two points—Harrisburg and Wrightsville—Hooker demanded that President Lincoln give him command of additional forces in order to move north toward the enemy. When Lincoln refused Hooker abruptly resigned and George G. Meade stepped into his place. Meade immediately ordered the army to march, in six columns, northeastward toward the line of Pipe Creek, the 1st, 3rd and 11th corps taking position between Emittsburg and Taneytown, the 2nd, 5th, and 6th corps taking position between Taneytown and Manchester.
In the night of June 30, Meade received word from Washington that the enemy forces on the Susquehanna had fallen back and seemed to moving in three directions toward Gettysburg. Meade ordered his army to prepare for a defensive battle behind Pipe Creek and sent John Reynolds, commander of the 1st Corps, supported by the 11th and 3rd Corps, to move toward Gettysburg; with the mission of retarding the anticipated movement of the enemy toward Pipe Creek, if possible, and then fall back. Because Reynolds did not encounter any infantry force approaching, he marched on to Gettysburg and hurriedly formed his corps into a battle line just west of the town, and soon was engaged with A.P. Hill's corps, marching out from the Cashtown Gap
PCN Tours Gettysburg Battlewalks: General Meade After Pickett's Charge
Did Meade want to fight at Gettysburg? Did Meade want to retreat on the evening of July 2nd? Why didn't Meade counter-assault the Army of Northern Virginia after the Pickett-Pettigrew-Trimble charge? National Park Service addresses these questions DVD