Private Git repositories for students, that don't become public later
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.