You can't avoid it but you can manage it :-)
I tried everything to avoid it.. But since my kom and sisters had it.. I developed it too..
Eat as healthily as possible, avoid heaps of carbs and processed sugars. Don't eat too much fruit and exercise. But all that's just going to help keep sugar levels under control so baby doesn't get as much sugar. You'll get it regardless of what you do but you can manage it before it takes affect. And good to get into the habit of avoiding sugar as mine wasn't found till 33 weeks and it was so hard to cut out all the stuff I loved so much when I feel like crud.