This question already has an answer here:
I am trying to explain the benefits of version control to a colleague (recent graduate with little software experience), but he doesn't think it is useful in his case.
I explained you commit every time you write a new function, fix a bug, or generally add anything useful to your code. The stuff he is working on started out not working, and all his changes are just attempts to fix problems (some of which are hardware limitations)
Is there a good general rule for how often to commit when you code isn't working? Normally, I try and not commit too much stuff that doesn't work, just when I stop working for a day, but if you are going to have long periods of code not working how often should you be committing?