Long time. If I'm israel, I would clean up North Gaza, that means removing rubble out of Gaza City. Then you build a fence splitting North Gaza from South Gaza. Then you'll build a military base in North Gaza.
Hamas will have less space to operate from.
The idea is to eliminate Hams entirely - wipe them off the face of the Earth. Nothing less.
Your fence has to extend deeper than they can dig.