"Gee" and "haw" are (were? I've never sat a gee) commands to horses, and "gee" was a nickname for a horse in Gilbert's time. So the Major-General has never ridden a horse.
What does sat a gee mean?
Stedman (273) assures us that in nineteenth-century England “gee” was a commonly used slang word for horse. Farmer and Henley (115) say the same. ... So “sat a gee” simply means rode a horse.
Who is the modern major general said to be patterned after?
The character who sings "I Am the Very Model of a Modern Major-General" was said to be modeled on the real-life Field Marshal Garnet Joseph Wolseley, an Anglo-Irish officer in the British Army. Rather than being offended by the caricature, Wolseley would sing the song to amuse his friends.