This history is found in the Padma Purana, Srstikhanda, Chapter 17:
Once Lord Brahma came to know that a demon, Vajranash, was killing people. Lord Brahma chanted a mantra on a lotus flower and killed the demon. During this process, the parts of flower fell on three places which were later known as Jyestha, Madhya and Kanistha Pushkar.
Later accompanied by brahmanas and other devas, or demigods, Lord Brahma went to Puskar to perform a sacrifice. To perform his yajna peacefully without being attacked by the demons, he created the hills around the Pushkar. Ratnagiri in the south, Nilgiri in the north, Sanchoora in the west and Suryagiri in the east and positioned demigods there to protect the yajna performance. Such Yajna sacrifices are to be performed along with one’s wife, so when the arrangements for the sacrifice were complete, Lord Brahma sent Narada rsi, the sage among the devas, to bring Sarasvati, Lord Brahma’s consort. But Sarasvati was not ready to leave, so Narada returned to Puskar alone.
According to astrological calculations, the sacrifice had to begin at once, so Brahma asked Indra, the king of the heavenly planets, to provide him a suitable wife to assist in the sacrifice. Lord Indra chose a cowherd girl, but the sacrifice required that the girl be of the brahmana caste. So the devas purified the girl, or elevated her caste, by passing her through a cow (into the cow’s mouth and out the other end), because in Vedic culture cows are considered pure and of the same caste as the brahmanas. The girl then became known as Gayatri, “one who was pulled through a cow.” She married Brahma and performed the yajna. When Saraswati arrived and saw that Brahma had married without her permission, so she cursed Brahma saying that he would be worshiped in Pushkar only. Saraswati (Savitri) also cursed Indra to be easily defeated in battles, Lord Vishnu to suffer the separation from his wife as a human, the fire-god Agni who was offered the yajna to be all-devouring and the priests performing the yajna to be poor. Endowed by the powers of yajna, Gayatri however diluted Saraswati’s curse, blessing Pushkar to be the king of pilgrimages, Indra would always retain his heaven, Vishnu would be born as the human Rama and finally unite with his consort and the priests would become scholars and be venerated. Enraged Saraswati (Savitri) went and established a temple on top of Ratnagiri, the hill a little south of Pushkar. Today pilgrims to Pushkar can visit temples of both Sarasvati Devi and Gayatri Devi. Sarasvati Devi is also present in this world in the form of a river. Five branches of that river Sarasvati, Supapra, Candra, Kanaka, and Nanda flow in the Pushkar area, but at present they are invisible to ordinary eyes.
It is also said that Lord Varaha appeared at Varaha ghat here, and Lord Rama came and bathed here. The sage Parasara is said to have been born here. His descendants, called Parasara brahmanas, are still found in Pushkar and the surrounding area.