Its not even clear yet who the sides are. Erdoğan released a statement that Gülen supporters (a religious group) were behind the coup, while the military seems to be claiming it is a secular coup, and has not named a leader behind it.
Turkish President Tayyip Erdogan used the Gulen movement as allies to gain power. However, once in power, Erdogan turned on Gulen, attempted to purge his followers from the police and judiciary, then used the movement as a "fifth-column" type scapegoat.
secularism in Turkey was born at the point of a bayonet. [..] Turkey's government is both secular and democratic, due to the founding father of Turkey, Kemal Ataturk. While Ataturk was a brutal dictator, he also used that power to rebuild a Turkish national identity, secularize the government, and eventually transition to democracy.
As many news sources have pointed out, the military sees itself as safeguarding the vision and (secular) state structure of Ataturk, and regularly purges the government when its leaders violate Ataturk's premise.
So it is most likely that the coup is secular in nature, and it is Erdogan's spin that is blaming Gulen.
This.
Turkey apologized to Russia, and normalized relationships with Russia and Israel. Also their Foreign minister talked about mending ties with Syria - Assad's Syria.
All this happened in the space of a few weeks. It was such an about-face from their past postutring. I guess this puts things in context.