Is the battery completely disconnected, and you closed the hood? Or, did you replace the battery, and now the key fobs don't work?
If it is the SECOND scenario, if you change the battery you will have to resynchronize the fobs. Stand next to the vehicle and press the lock and
unlock buttons on the fob at the same time and hold for 7 seconds. That should synchcronize the fobs to the car again..
But seriously, can't you just use your key to unlock the drivers door to get in, then unlatch the hood?
If your car has keyless entry (I have never, and will never own a GM vehicle) and you have NO keys to open the doors, and the doors are locked because there is no battery installed to unlock them, you have two choices I can think of (legal ones).
1 Call a professional locksmith. (that deals with automobiles)
Many insurance companies cover this as part of your policy.
2. Call the police and ask for help. They usually carry a jimmy tool and if you are very very nice to them they MAY open it for you if you can first prove you own the vehicle.. (they are NOT required to help)
3. Bust out a window, open the door, pop the hood, install a new battery, synchronize the key fobs, test the door locks to make sure they work, then call the dealership to replace the window you broke.. (unless you know a good shade-tree mechanic, and can get a replacement window from a salvage yard.