The dates given in Wikipedia's Bhagavad Gita article, for example,
Professor Jeaneane Fowler, in her commentary on the Gita, considers second century BCE to be the likely date of composition.
The so-called "Hindu Synthesis" emerged during the early Classical period (200 BCE - 300 CE) of Hinduism. According to Alf Hiltebeitel, a period of consolidation in the development of Hinduism took place between the time of the late Vedic Upanishad (ca. 500 BCE) and the period of the rise of the Guptas (ca. 320–467 CE) which he calls the "Hindu Synthesis", "Brahmanic Synthesis", or "Orthodox Synthesis". It developed in interaction with other religions and peoples:
The emerging self-definitions of Hinduism were forged in the context of continuous interaction with heterodox religions (Buddhists, Jains, Ajivikas) throughout this whole period, and with foreign people (Yavanas, or Greeks; Sakas, or Scythians; Pahlavas, or Parthians; and Kusanas, or Kushans) from the third phase on [between the Mauryan empire and the rise of the Guptas].
... and in Wikipedia's Krishna article,
Worship of the deity Krishna, either in the form of deity Krishna or in the form of Vasudeva, Bala Krishna or Gopala can be traced to as early as the 4th century BC.
... compared with the dates in the Gautama Buddha article,
The times of Gautama's birth and death are uncertain. Most historians in the early 20th century dated his lifetime as circa 563 BCE to 483 BCE.
... suggest to me it's possible that maybe the Buddha lived a little bit earlier (e.g. 100 years or more) than when Krishna became famous and when the Gita was composed.
If it's true that the Gita was written during a "synthesis" which occurred as a reaction to competition from Buddhism and Jainism and so on, that could explain why there's no commentary from the Buddha (i.e. that he lived slightly before then, and so any commentary would be anachronistic).
There are Buddhist suttas which recount the Buddha's talking with brahmins.
In summary the first sentence of the OP (i.e. "As Hinduism was a prominent religion of the Buddha's time (though not in today's unified form), Buddha must have learnt about the Gita and krishna's philosophy.") might be a slightly incorrect assumption.