Project hosting sites move in and out of popularity in much the same way that programming languages do. They become suddenly popular, the place to host for cool new projects; then they mature into wide but less-enthused use; and finally, they begin a long decline in which they increasingly are associated with legacy projects.
Because the highest visibility hosts today, GitHub and its predecessor in the top position, SourceForge, are both offshoots of companies that sell code-hosting solutions, it's easy to forget that most hosts did not and do not have material commercial benefits to derive from hosting open source.
In fact, in the early days, such hosting was seen more as a service to a community than a profitable activity. Often, the hosts were created as the centerpieces of developer communities. The Apache Software Foundation is one such and is still very active. Another is Codehaus, a site purpose-designed by a group of hackers (Bob McWhirter, Jason van Zyl, and later Ben Walding) to host their projects and those of like-minded developers. Codehaus, in particular, provided more than just code hosting: email support, continuous integration, and other services. By offering what was then a very rare compliment of services completely free, it was able to attract top projects, including Drools, Groovy, Maven, and others. Its revenue source was ads placed here and there. My own open source project page layout and typesetting software, Platypus was hosted there for years. But ultimately, the work of maintaining Codehaus became more than one or two people could handle while doing other full-time work, and the site has become almost quiescent. Most major projects, except Groovy, have moved elsewhere. It is well into the long decline that characterizes hosts that have lost their popularity. Tigris.org, a community site founded to develop collaboration tools is in a similar position: Today, it no longer accepts new projects.
These sites lived and slowly died in the shadow of SourceForge, the major project host founded by VA Software in 1999. For several years, SourceForge was the cool place to host projects the GitHub of its day. But while it was popular, it was not truly loved due to its heavy use of ads and a confusing download mechanism that required you to watch ads and, at various times, tried to foist unwanted downloads on visitors. Its supremacy was challenged when Google Code was unveiled, but it proved remarkably resilient and remained the #1 site for hosting projects until earlier this year when GitHub's traffic finally surpassed it.
The launch of Google Code is another example of the fateful rise and long decline. When it first came out, it was a mecca for new projects, seeded by the many projects of Google employees. It had a fairly low-tech UI, but it was fast and simple to operate. In addition, it had a variety of features that appealed especially to programmers. However, Google moved slowly in improving the site to recognize changing developer preferences. And the company did not update its peculiar UI. And it was less than helpful to user requests. All were crucial missteps.
So when the modern leaders of code hosting, BitBucket and GitHub, emerged, the developer community was ready to migrate to them in the hopes of finding exactly what they got: hosts that were both engaged with their communities and committed to constantly expanding and improving their services.
Along the way, many other hosts have risen briefly before falling and slipping into a long-term decline. The largest group being language-specific hosts: RubyForge, Java.net, and so on.
BitBucket and GitHub, I expect, will continue to thrive. GitHub is today the #1 host, measured by both traffic and number of users. According to Alexa.com, there follow (in order): SourceForge (in clear decline), BitBucket, Microsoft's Codeplex (stable), and Google Code (also in steady decline).
Codeplex is the odd entry in this group. While Microsoft has not traditionally been known for open source, the Codeplex site quietly gets plenty of traffic. How long this will last is unknown, given that when Microsoft released the open source code to the .NET core, they did so on GitHub. When I asked Microsoft VP "Soma" Somasegar why, he replied that the company wanted to meet developers "where they already were." Based on reactions culled from Hacker News and Reddit, this choice proved wise. Many comments on those aggregators stated that the choice of GitHub convinced the authors that the "new Microsoft" was moving away from its closed, "come to us" approach to development. A similar desire surely prompted Google's increasing use of GitHub, rather than Google Code, for its projects.
GitHub and BitBucket offer similar sets of services, with the notable exception that BitBucket offers free private repositories. How long they can remain hosting leaders is hard to tell, but I expect that it will be quite a while. Unlike their predecessors, they both are run by organizations that have a deep understanding of developer needs and preferences, and they are centerpieces of their owners' holdings, and so receive constant care and attention. If either site should slip, however, a very long, painful decline awaits.