the root method for the D2G is the same as the D2. jerry did a full write-up
here that will walk you through rooting your D2G. its the same method as the D2.
Its actually a stickied thread at he top of the ROM's and hacks section. There are a few thread there that i think you should thoroughly read through so that you can get an idea of what to do when rooting and how to go back.
1) Root your phone
2) Flash a custom recovery
3) backup your device
4) learn how to SBF in the off chance you brick your device.