How much time do you have? As a cyclist, ex-cramper, and kidney stone sufferer, I've been there. Bmart and JAS are both right in their statements.
Long story short - you should pee 2.5 liters a day, and your pee should be almost clear. Figure out how much you have to drink to do that. It's more than 2.5 liters. If you really want to know, weigh yourself before and after your "sweat event". Water weighs 7.5 lbs/gallon, and you need to replace it. If you're sitting around at home, it's less water. If you're sweating at the track or in the yard, it's more.
If your clothes and skin are "very" salty after sweating (everyone is different) you need more electrolytes. Not everyone's sweat has the same amount of salt in it. Gatorade isn't garbage, but it has more sugar than you need, and sugar slows the rate at which your body can absorb electrolytes, so something with less sugar will allow the electrolytes to be absorbed faster. The sugar/high fructose corn syrup is what upsets your stomach, but believe it or not your muscles basically burn sugar, so you need it from some source of carbs. Gatorade makes a drink called Gatorlyte that has the electrolytes but way less sugar. You can also make your own sports drinks since they are really just water, sugar, salt, and flavor. They also sell sports drinks designed for endurance sports with different ratios of electrolytes and calories from sugar that will keep your muscles going, but you don't really need those at a track day where you can eat between sessions, they are more for cycling so you are getting your calories while you ride. The current thinking in the cycling world is that you should eat your carbs (for energy and muscle endurance) and drink your electrolytes (the low sugar kind) to speed how your body can absorb the carbs. My son has experimented with this approach on 5 and 6 our bicycle rides with good success.
Bananas are an excellent source of potassium, with about 450 mg each, and are a good source of magnesium too. Believe it or not, you should have something like 3,500 mg a day of potassium, so that would indeed be 7 bananas if that was your only source, but.....it's not. Potatoes have something like 1,500 mg each, but oddly enough you never see someone with a potato in the back pocket of their cycling jersey, probably because they are too heavy and hard to chew.
The sources of cramps have never really been figured out. It's usually some blend of low electrolytes in a person who sweats a lot, over exertion from someone not trained enough, and....being a person prone to cramping.