Set up a tent village outside the Gaza fence for Gaza civilian residents and those who don't want to be caught in the crossfire. Enable them to exit Gaza and live in tent village until the fighting is over. The Pakistanis did it in Sowat when they cleared out the Taliban. Afterwards the non-Taliban residents returned to their homes unharmed. If the Pakistanis did it, so can the Israelis.
Netanyahu condemns West Bank arson attack, calling it 'terror' (Haaretz)
from the article: Netanyahu: Israel will continue to operate against terrorists in Gaza