who was the commander of the union army of the battle of gettysburg?