According to this archived article[1], there is a quote saying: "It [BB] sports a feature-set much like Github." That is an indication of which one came first and was already a success story on the market and served as a blueprint for BB, which was made in its image with the difference of supporting mercurial, instead of git.
[1] https://web.archive.org/web/20110317200833/http://code.djang...
(edit) forgot the link to the article
Of course there are plenty of elements from GitHub that existed in previous systems in some form of the other, and I'm sure the GitHub people looked at them. But the way GitHub implemented things was a marked shift from what came before (the most significant being the "source-first" view of projects – rather than "wiki first" view of Trac of listing of attributes of SourceForge – and their implementation of Pull Requests).