Israel can significantly reduce the presence of Hamas in Gaza in the short term, but in regards to "ridding Gaza of Hamas" it would likely require following the advice Arnaud Amalric gave to troops attacking the Cathar stronghold of Béziers during the Albigensian Crusade.
And what would that be?