Github isn't the only choice, but I think it's the preferred choice for a code sharing community because they basically give their product for free for open-source projects on public repositories. And it's easy and good looking.
Bitbucket distinguishes itself from Github by making itself free for small teams only, but allowing you free private repositories. Seems like they are more interested in businesses and proprietary code.
It's not immediately apparent from the front accessible parts of Bitbucket's website, but if you refer users with a provided link you also get up to 3 extra free users.
Bitbucket distinguishes itself from Github by making itself free for small teams only, but allowing you free private repositories. Seems like they are more interested in businesses and proprietary code.