Several things linked all the Greek city-states together.
|An actual map of the known world that was drawn by the Greek historian Herodotus around 1200 BC|
The first common link was religion.
You are probably familiar with Greek mythology and some of the stories.
Much of the Greek religion is found in two epic poems written around 1200BC by a blind poet by the name of Homer.
The Iliad and the Odyssey contained descriptions of the Trojan War fought between the Kingdom of Troy and the Greek city-states. Another thing that linked the city-states together was their language.
Even taking into account different dialects, most Greeks could understand each other.