Problem of Old Testament Genocide

Problem of Old Testament Genocide
How can a God of love command that the armies of Israel wipe out the inhabitants of the promise land?
How can a God of love command that the armies of Israel wipe out the inhabitants of the promise land?