At the beginning of the Civil War, Getty was a captain in the 4th U.S. Artillery. In September, 1861, he was appointed lieutenant colonel. He commanded four batteries in Maj. Gen. George B. McClellan's 1862 Peninsula Campaign. Named Chief of Artillery of Maj. Gen. Ambrose Burnside's IX Corps, he served at the battles of South Mountain and Antietam during the Maryland Campaign. On September 25, 1862, Getty was promoted to the rank of brigadier general of volunteers and assigned to the infantry. During the Battle of Fredericksburg in December, he commanded the 3rd Division of IX Corps. In March, 1863, Getty's division was sent to Suffolk, Virginia, where the Federal Army under Maj. Gen. John A. Dix successfully resisted Lt. Gen. James Longstreet's investment of the town, which guarded the southern approaches to Norfolk and Hampton Roads.