Contradiction with Matthew 5:44
2 Samuel 18:7 describes a battle and the slaughter of twenty thousand men, while Matthew 5:44 teaches to love your enemies and not engage in violence.
Matthew 5:44: But I say unto you, Love your enemies, bless them that curse you, do good to them that hate you, and pray for them which despitefully use you, and persecute you;
Contradiction with Exodus 20:13
2 Samuel 18:7 involves the killing of many men in battle, in contrast to the commandment "Thou shalt not kill" found in Exodus 20:13.
Exodus 20:13: Thou shalt not kill.
Contradiction with Isaiah 2:4
2 Samuel 18:7 recounts a violent battle, whereas Isaiah 2:4 envisions a future where nations will not engage in war anymore.
Isaiah 2:4: And he shall judge among the nations, and shall rebuke many people: and they shall beat their swords into plowshares, and their spears into pruninghooks: nation shall not lift up sword against nation, neither shall they learn war any more. [pruninghooks: or, scythes]
Contradiction with Romans 12:19
2 Samuel 18:7 depicts taking vengeance in battle, while Romans 12:19 advises against taking vengeance and leaving it to God.
Romans 12:19: Dearly beloved, avenge not yourselves, but [rather] give place unto wrath: for it is written, Vengeance [is] mine; I will repay, saith the Lord.
Contradiction with James 3:17-18
2 Samuel 18:7 is about conflict and destruction, contradicting James 3:17-18, which speaks about wisdom that is peaceable and sows peace.
James 3:17-18: But the wisdom that is from above is first pure, then peaceable, gentle, [and] easy to be intreated, full of mercy and good fruits, without partiality, and without hypocrisy. [partiality: or, wrangling]