Plans and movement to battle

Throughout the evening of July 1 and morning of July 2, most of the remaining infantry of both armies arrived on the field, including the Union II, III, V, VI, and XII Corps. Longstreet's third division, commanded by Maj. Gen. George Pickett, had begun the march from Chambersburg early in the morning; it did not arrive until late on July 2.

The Union line ran from Culp's Hill southeast of the town, northwest to Cemetery Hill just south of town, then south for nearly two miles (3 km) along Cemetery Ridge, terminating just north of Little Round Top. Most of the XII Corps was on Culp's Hill; the remnants of I and XI Corps defended Cemetery Hill; II Corps covered most of the northern half of Cemetery Ridge; and III Corps was ordered to take up a position to its flank. The shape of the Union line is popularly described as a "fishhook" formation. The Confederate line paralleled the Union line about a mile (1,600 m) to the west on Seminary Ridge, ran east through the town, then curved southeast to a point opposite Culp's Hill. Thus, the Federal army had interior lines, while the Confederate line was nearly five miles (8 km) long.

Lee's battle plan for July 2 called for Longstreet's First Corps to position itself stealthily to attack the Union left flank, facing northeast astraddle the Emmitsburg Road, and to roll up the Federal line. The attack sequence was to begin with Maj. Gens. John Bell Hood's and Lafayette McLaws's divisions, followed by Maj. Gen. Richard H. Anderson's division of Hill's Third Corps. The progressive en echelon sequence of this attack would prevent Meade from shifting troops from his center to bolster his left. At the same time, Maj. Gen. Edward "Allegheny" Johnson's and Jubal Early's Second Corps divisions were to make a demonstration against Culp's and Cemetery Hills (again, to prevent the shifting of Federal troops), and to turn the demonstration into a full-scale attack if a favorable opportunity presented itself.

Lee's plan, however, was based on faulty intelligence, exacerbated by Stuart's continued absence from the battlefield. Instead of moving beyond the Federals' left and attacking their flank, Longstreet's left division, under McLaws, would face Maj. Gen. Daniel Sickles's III Corps directly in their path. Sickles was dissatisfied with the position assigned him on the southern end of Cemetery Ridge. Seeing higher ground more favorable to artillery positions a half mile (800 m) to the west, he advanced his corps—without orders—to the slightly higher ground along the Emmitsburg Road. The new line ran from Devil's Den, northwest to the Sherfy farm's Peach Orchard, then northeast along the Emmitsburg Road to south of the Codori farm. This created an untenable salient at the Peach Orchard; Brig. Gen. Andrew A. Humphreys's division (in position along the Emmitsburg Road) and Maj. Gen. David B. Birney's division (to the south) were subject to attacks from two sides and were spread out over a longer front than their small corps could defend effectively.

Longstreet's attack was to be made as early as practicable; however, Longstreet got permission from Lee to await the arrival of one of his brigades, and while marching to the assigned position, his men came within sight of a Union signal station on Little Round Top. Countermarching to avoid detection wasted much time, and Hood's and McLaws's divisions did not launch their attacks until just after 4 p.m. and 5 p.m., respectively.

Attacks on the Union left flank

As Longstreet's divisions slammed into the Union III Corps, Meade was forced to send 20,000 reinforcements in the form of the entire V Corps, Brig. Gen. John C. Caldwell's division of the II Corps, most of the XII Corps, and small portions of the newly arrived VI Corps. The Confederate assault deviated from Lee's plan since Hood's division moved more easterly than intended, losing its alignment with the Emmitsburg Road, attacking Devil's Den and Little Round Top. McLaws, coming in on Hood's left, drove multiple attacks into the thinly stretched III Corps in the Wheatfield and overwhelmed them in Sherfy's Peach Orchard. McLaws's attack eventually reached Plum Run Valley (the "Valley of Death") before being beaten back by the Pennsylvania Reserves division of the V Corps, moving down from Little Round Top. The III Corps was virtually destroyed as a combat unit in this battle, and Sickles's leg was amputated after it was shattered by a cannonball. Caldwell's division was destroyed piecemeal in the Wheatfield. Anderson's division, coming from McLaws's left and starting forward around 6 p.m., reached the crest of Cemetery Ridge, but it could not hold the position in the face of counterattacks from the II Corps, including an almost suicidal bayonet charge by the small 1st Minnesota regiment against a Confederate brigade, ordered in desperation by Hancock in order to buy time for reinforcements to arrive.

As fighting raged in the Wheatfield and Devil's Den, Col. Strong Vincent of V Corps had a precarious hold on Little Round Top, an important hill at the extreme left of the Union line. His brigade of four relatively small regiments was able to resist repeated assaults by Brig. Gen. Evander M. Law's brigade of Hood's division. Meade's chief engineer, Brig. Gen. Gouverneur K. Warren, had realized the importance of this position, and dispatched Vincent's brigade, an artillery battery, and the 140th New York to occupy Little Round Top mere minutes before Hood's troops arrived. The defense of Little Round Top with a bayonet charge by the 20th Maine was one of the most fabled episodes in the Civil War and propelled Col. Joshua L. Chamberlain into prominence after the war.

Attacks on the Union right flank

About 7:00 p.m., the Second Corps' attack by Johnson's division on Culp's Hill got off to a late start. Most of the hill's defenders, the Union XII Corps, had been sent to the left to defend against Longstreet's attacks, and the only portion of the corps remaining on the hill was a brigade of New Yorkers under Brig. Gen. George S. Greene. Because of Greene's insistence on constructing strong defensive works, and with reinforcements from the I and XI Corps, Greene's men held off the Confederate attackers, although the Southerners did capture a portion of the abandoned Federal works on the lower part of Culp's Hill.

Just at dark, two of Jubal Early's brigades attacked the Union XI Corps positions on East Cemetery Hill where Col. Andrew L. Harris of the 2nd Brigade, 1st Division, came under a withering attack, losing half his men; however, Early failed to support his brigades in their attack, and Ewell's remaining division, that of Maj. Gen. Robert E. Rodes, failed to aid Early's attack by moving against Cemetery Hill from the west. The Union army's interior lines enabled its commanders to shift troops quickly to critical areas, and with reinforcements from II Corps, the Federal troops retained possession of East Cemetery Hill, and Early's brigades were forced to withdraw.

Jeb Stuart and his three cavalry brigades arrived in Gettysburg around noon but had no role in the second day's battle. Brig. Gen. Wade Hampton's brigade fought a minor engagement with newly promoted 23-year-old Brig. Gen. George Armstrong Custer's Michigan cavalry near Hunterstown to the northeast of Gettysburg.