I agree that gas is not going to explode due to heat in a garage, but I would not try to store too much unless you think it through. I'm no expert, but what I've seen is to have 5 gal cans that are continually being rotated and used up. For example, every time you fill your car, put the gas from the oldest can in the car then go fill up the car and re-fill the 5 gal tank. It's known that gas deteriorates with age and I suspect that heat causes it to deteriorate quicker.
Also, if I was going to store gas, I would find a source of ethanol free gas. I actually do store gas over winter and I use my gas that mixed with oil so infrequently that it goes over a year per gallon that I mix up. Ever since I went with ethanol free gas I've not had any problems with my small engines.
Here's a site that lists ethanol free gas:
https://www.pure-gas.org/