github-education-resources / teachers

Join the discussion in the GitHub Education Community:
https://education.github.community
197 stars 21 forks source link

Damage control #10

Open Drealmer opened 10 years ago

Drealmer commented 10 years ago

I have been using svn as source control for a programming class over the last few years and I am currently in the process of transitioning to git. The main thing that worries me is that very often my students would inadvertently commit files that do not belong in source control, especially large temporary files, and I not sure how to deal with that on the git side. With svn, I had a post-commit hook that would abort invalid commits (file size, file type, etc).

I know about gitignore, but from some previous experience with mercurial, I have been spending way too much time dealing with students who failed to properly setup their ignore files and kept on pushing huge files.

Most advice I could find on the web about this problem usually ends up with “educate your users”, but every year I get a new batch of a hundred new students who are brand new to programming and source control, and they are bound to make mistakes at one point or another. I need an efficient way of dealing with that, all your suggestions are welcome.

jpgcc commented 10 years ago

Would the same gitignore file fit all students? If so, you could probably provide them with the content for the gitignore file, but have them set up the file as one of their first tasks (so they can get accustomed to that, see the difference between "before gitignore" and "after gitignore").

afeld commented 10 years ago

No setup is needed for gitignore as long as the file is present in the repository, so you could simply include these in the boilerplate repository. If the instructions for starting the assignment involve using an existing repository, then no extra step would be needed on the students' end.

GitHub doesn't support server-side hooks exactly (that is, pushes couldn't be blocked – see webhooks), but you could set up a Git server for this if you needed it.