Gainesville has existed for a long time, our history dating back before the Civil War! But this city wasn't always called "Gainesville". It used to be a small rural community back in the 1800's, and was called "Hogtown". It was named after one of the bigger commodities, you see...
In the early 20th century, when the Florida State Legislature decided to establish a State University System, they had to pick a city for what was going to become the University of Florida. For various reasons, Hogtown was being considered. Of course, one can't have the state's first University established in a city named after our porcine friends (even if it is the other white meat), so the city goverment scrambled to rename the town. It was decided to name it Gainesville after General Gaines, who had centered some of his operations during the Civil War in Hogtown (as well as half the other cities in Florida, but hey...) So Hogtown became Gainesville.
The Florida Legislature awarded Gainesville the honor of being home to the University of Florida... and ever since, Gainesville's tried to pretend it's more than a giant pig farm, :)