The battle of Gettysburg took place on the 1st through the 3rd of July 1863. Prior to this, the confederate government had approved General Lee's plan to invade the north. After the events at Winchester, Lee was able to move unchecked into the Cumberland Valley of Pennsylvania. General Lee approved a plan from J.E.B. Stuart a cavalry officer. His plan was to take three brigades of cavalry across the Blue Ridge Mountains in order to cut of the feds supply routes. Unfortunately Stuarts march encountered numerous delays and detours at the hands of an increasingly aggressive union force. Stuart would not be able to rejoin Lee until July 2. By June 28, Lee had moved two corps into Chambersburg and he had sent divisions of Ewells corps into York and Carlyle. Lee learned later that day that the federal army was at Frederick and that their commanding officer had been replaced. Lee decided to move his entire army east of the mountain and to attempt to engage the feds. At the same time, the Union officer General Meade was moving his army north. Both armies were converging on Gettysburg. On June 30, the confederates discovered that Gettysburg was occupied. The occupiers were from General Buford's division of Federal Cavalry. On the 1st of July, Lee sent two divisions down the road leading into Gettysburg in order to drive Buford away and to allow them to occupy Gettysburg. The first shots the battle rung out around 05:30 that morning as shots were exchanged over Marshes Creek. The Confederates pushed on cautiously until they were two miles from Gettysburg. At this time, two brigades of confederate soldiers were put into line formation and commanded to advance on the Federal forces. Both sides attempted to reinforce throughout the battle but by the end of the day, it was the Union soldiers who were in retreat. The day had been a Confederate victory with 3000 fewer losses than their enemy.