Private Git repositories for students, that don't become public later Short version of my question: Is there a good way to provide students with free, private, Github-like git repositories, that won't become public later?

Background: In computer science, it is considered best practice to use Git (a version control repository) for software development.  Many universities want to encourage students to follow those best practices as part of their coursework, so they'd like to encourage students to do the same.  However, they don't want student work to be made public, as this creates a temptation for cheating.

Github in particular is popular, as it provides both Git repositories, an easy-to-use web front-end to Git, and a convenient workflow for collaborating using Git.  Github is free if you make your repository public; normally, you have to pay for a private repository.  Github has a special program for students: as long as you are a student, you can have private repositories for free, if you sign up for their student discount.  However, this only lasts as long as you are a student.  After two years, the student discount expires, and then the private repositories are locked; if the ex-student wants to retain access to their repositories, the ex-student has 30 days to either pay Github a monthly fee to keep it private, or they can tell Github to make it public and pay nothing.

One university I'm familiar with encourages CS students to sign up for a student Github account and put their projects and homeworks in private repositories.  However, empirically, Github's policies seem to encourage a certain number of students to make all their repos public after they graduate and their student status expires -- and then solutions are available on the Internet.  Because good software development projects are so labor-intensive to construct, many courses re-use projects for several years in a row.  Current students have reported finding this by search and are a bit worried that it'd be so easy for other students to cheat.  Therefore, recommending that students use a private Github account seems to create a two-year time bomb that will have unfortunate consequences for courses who plan to use their project for more than two years running.

Is there any good solution to this?  Is there a better alternative than Github that can be recommended to students?

In particular, a better alternative should meet the following requirements: allow students to have Git repositories for software development and collaboration with project partners; is free; is private; will remain private over time, without encouraging/requiring alumni to make their solutions public if they want to retain access to their solutions without paying; doesn't create extra work for instructors to constantly search Github to look for inadvertently-public solutions from past semesters.

I've seen How to deal with student putting their (home)work on github, but the solutions there aren't workable in this context: creating new projects every semester is not a good solution (it's been tried and leads to pedagogically inferior results).
Update January 2019: GitHub now has free private repositories.



Bitbucket offers unlimited private repositories. I use it for this purpose. 

You can also host your students' repositories yourself on your own server with Gitlab (the community edition is free). This option has the advantage that you aren't asking your students to trust a third party with their data. I sometimes use this option, too. It's very easy to set up.

However, having students' work in repositories that don't automatically becomes public doesn't obviate the need to create new projects - students can still opt to post their work publicly. (This is true even if you don't use Git in the course at all.)

Personally, I typically use Bitbucket and ask students to keep their repositories private for the duration of the course (so as not to make cheating too easy), but they are free to make them public later. Part of the appeal of project-intensive courses to students is that they create something they can show off to potential employers. I want my students to have the option to make their work (which is often very impressive, and which they have put a great deal of effort into) public, so that they can enjoy this benefit.  I occasionally see students publish their repositories, put a link on their résumés or LinkedIn profiles, and then continue to improve their projects for months after the course is over, which is extremely gratifying.

I would consider it a disservice to students to prevent them from showing off their work after the course is over or after they graduate, even if I could prevent this. My university does not claim ownership of intellectual property produced by students in the context of uncompensated coursework (unless there is an explicit written agreement stating otherwise), so unless their projects also include material which I hold the copyright to, I couldn't stop them from publishing their work even if I wanted to.