In my opinion no actual god ordered the mass murdering described in the old testament. Human beings murdered all by themselves. Deluded perhaps. But it was humans, whether ordered to murder by a mad leader or a jealous one or a greedy one, it was humans who murdered. They might have fabricated a reason to do so. There simply was no god there to order such events, and they were bloody, horrendous events. Using "god" as a pretense to stir up supporters is not new. We see it happening right before our eyes in the USA and around the world right now.
What kind of fool are we to accept such explanation for historical atrocities? The slaughters, thefts, plunder, kidnapping, raping and torture are all part of human history and we, even we in the USA, are not innocent of such behaviors.
These were nomadic peoples who were led by desert warlords. I suspect that they dreamed up the idea of god so that their practical pronouncements would take on "divine command," making it easier to enforce the man-made laws. Look at pork. Old Leviticus says it is a no no, but why? Duh! They did not have refrigerators and, at the time, pork when it went bad sometimes contained trichinosis. No pork, no death from worms. The proscription against homosexuality was based on the need of populating quickly and in great numbers, the only protection you had from the Philistines just over the hill. As we all know, homos don't have babies. Take it a step further: the "other Gods before me" included deities whose voluptuaries included transvestite prostitutes; dalliance with a person of your own sex doesn't normally produce babies, either. There are other good examples.