Read this passage and open each verse for the full verse feed and commentary tools.
10When you draw near to a city to fight against it, then proclaim peace to it. 11It shall be, if it make you answer of peace, and open to you, then it shall be, that all the people who are found therein shall become tributary to you, and shall serve you. 12If it will make no peace with you, but will make war against you, then you shall besiege it: 13and when Yahweh your God delivers it into your hand, you shall strike every male of it with the edge of the sword: 14but the women, and the little ones, and the cattle, and all that is in the city, even all the spoil of it, shall you take for a prey to yourself; and you shall eat the spoil of your enemies, which Yahweh your God has given you. 15Thus shall you do to all the cities which are very far off from you, which are not of the cities of these nations. 16But of the cities of these peoples, that Yahweh your God gives you for an inheritance, you shall save alive nothing that breathes; 17but you shall utterly destroy them: the Hittite, and the Amorite, the Canaanite, and the Perizzite, the Hivite, and the Jebusite; as Yahweh your God has commanded you; 18that they not teach you to do after all their abominations, which they have done to their gods; so would you sin against Yahweh your God.
19When you shall besiege a city a long time, in making war against it to take it, you shall not destroy the trees of it by wielding an ax against them; for you may eat of them, and you shall not cut them down; for is the tree of the field man, that it should be besieged of you? 20Only the trees of which you know that they are not trees for food, you shall destroy and cut them down; and you shall build bulwarks against the city that makes war with you, until it fall.
Deuteronomy 20:10-20 (WEB)