Gestational Diabetes?

Does eating sugar cause this. I have a test in a couple weeks, should I be cutting out sugar while pregnancy to prevent GD? Or is it just having a healthy diet?