Most of the violence in the old testament is war. People fought wars in those days differently than we usually fight wars today. In those days warfare meant attacking your enemy and utterly destroying them. Wiping them out. A massacre. Men women and children. God commanded the Israelites on a number of times to do jut that. But note that those commands were to -in those days- wage war. But God did not create the rules of warfare, men did. So the command was to go and wage war just like everybody else does. That doesn't make it less brutal, it merely explains what was happening at the time.
It's funny that the Christianization of the West was what led to the rules of warfare today. At least in the Western world. Armies line up on a battlefield and fight each other all the while pretty much leaving the civilian population alone. If you look to history to find a comparison between "Christian" warfare and other cultures you'll find something of a comparison in the Declaration of Independence. One of the grievances the Colonists had with King George:
He has excited domestic insurrections amongst us, and has endeavoured to bring on the inhabitants of our frontiers, the merciless Indian Savages, whose known rule of warfare, is an undistinguished destruction of all ages, sexes and conditions.
You can see the shock of comparing European warfare with the warfare of the Indian tribes. Their form of warfare hadn't changed since old testament times.