who was the union commander of the battle of gettysburg?