who was the general of the union army at gettysburg