who was the the union commander in battle of gettysburg?