David did as Yahweh had commanded him.
The outcome of this battle was that David killed Philistines from Geba all the way to Gezer.