Git felt like it had "inevitable" momentum way before GitHub.
In 2005 my company was using Darcs. We had previously used CVS and then Subversion. Darcs felt like finally the right, modern, decentralized version control system had arrived, even though there was no GitHub for it. Darcs was magical in ways that Git still can't measure up to.
But arround me more and more colleagues were starting to use Git, which they gushed about as being the new cool thing. Git, at that time, was barely more than a very unfriendly set of commands with barely any documentation. But even before GitHub it seemed like "worse is better" was clearly winning over Darcs and the other new contenders.
By circa 2007 we had switched over. The thing that really pushed us over was that Darcs had a huge, work-stopping bug that the authors could not resolve. Darcs 2 eventually made the bug less of a problem, but it was too late, and at that point it was even more niche than in 2005.
GitHub was clearly instrumental in cementing Git's "monopoly" on version control. Once GitHub was out, the writing was on the wall.
I originally thought to write "Git winning might be as simple as linux and github using it.", before I decided to shorten it:) Yes, I think that was a significant factor.
not to mention that many at mozilla cried over the loss of mercurial, with some mozillians part-time mercurial contributors rolling-up their sleeves and putting their weight behind jj as a "lesser evil" kind of compromise.
People learnt git to use GitHub