Sourceforge became almost useless a long time before GitHub came on the scene though. AFAIR they were taken over by a commercially focused company and then added more advertising and inserted shovelware/malware into downloads.
Again, my recollection (as a non-programmer) was Subversion repos were popular at this time -- launchpad.net linked source code was nearly all SVN -- and the likes of Tucows for MS Windows binaries, and other non-SF sites like Freshmeat became useful again.
Then Linus came out with `git` and the ecosystem shifted.
TL;DR to my recollection there was a gap between SF's decline and GitHub's rise, so the GitHub didn't cause SF's decline?
It's clear why sourceforge went away - GitHub is just better in every way imaginable.