Cramps near your right hand side are usually diaphragm cramps (side stitches) more toward the left are usually from having eaten too close to a hard effort. You get them on hills because you are working really hard!
There are a few things you can do to prevent them - warm up thoroughly before putting out really hard efforts (10 minutes was probably not enough), try to avoid shallow breathing/hyperventilating and don't eat a large meal right before going out and riding. Try to eat about 2 to 3 hours before hand.