GitHub is an interesting example, because if I push code to GitHub, I still have my local source, and being an open protocol I can easily push it elsewhere as well.
There's no conflict between these things. You can run your own private/semi-private repo, mirror to github and use github for the public facing features you're mentioning. That doesn't stop your own repo from continuing to exist (whether or not it is considered canonical or not).