The acquisition talks turning serious mark a change of strategy as just six months ago GitHub appeared committed to staying independent, the report said on 1 June citing people close to the companies.
The San Francisco, California-headquartered GitHub has more than 23 million individual users in more than 1.5 million organisations. Software developers use the tools of the privately-held company to store code, keep track of updates and discuss issues.
According to a CNBC report, the talks of acquisition progressed from a planned joint marketing partnership valued around $35 million.
GitHub was last valued at $2 billion in its last funding round in 2015.
Based on a price that was floated last year, the report said that acquiring GitHub could cost Microsoft $5 billion or more - more than what Microsoft currently wanted to pay.
The talks come at a time when GitHub is reportedly struggling to replace CEO and founder Chris Wanstrath, who announced his resignation about 10 months ago.
Microsoft reportedly toyed with the idea of acquiring GitHub in the past too, including in 2016, although GitHub did not confirm those reports.