“and cut a covenant with them to let them live.” The covenant that Israel made with the Gibeonites shows that sometimes one thing in the Law is greater than other points. The Law said to kill the people of the land, but Joshua made a covenant with them, and that direct covenant was more binding than commandments such as Deuteronomy 7 in the Law. This kind of thing is how case law is established. “To let them live;” Joshua did not cut a covenant with that purpose, since he thought they came from far away he was not commanded to kill them, but it was the result of the covenant that Joshua made.
“swore an oath.” The verb means to swear an oath.