Bitbucket offers unlimited private repositories for academic accounts that you can get by using your uni email id. I'm writing my PhD dissertation using Lyx and use Mercurial for version control, so I store my code in a private repo on bitbucket. I think version control is indispensable for large research projects that are completed over a long time frame, so using a repository would obviously fit right in.
But making your stuff public serves no useful purpose, neither for you, nor for the academic community that would be interested in your research. You make something public when it is ready to see the light of the day. Till then, you receive feedback from your supervisor and colleagues, and improve the quality of your work until it is good enough to be of use to others
Making half-assed research public is a crime against academia, can reflect poorly on you, and in any case conferences are the best venue for discussing work in progress and for getting your work time-stamped by a large gathering of people in your field who know each other, and this can prevent "scooping". However I must say I'm sceptical that such a thing even exists in academia, your research can only be done by you.
Journalists search for novelty, and can therefore be scooped. We academics, on the other hand, search for credibility, which only comes from knowing "your" idea inside out. If somebody else can do more credible work with your idea, then they get the Nobel, you get the citation.