It seems to be a generally accepted good practice not to push invalid, broken, or incomplete code. But one of the huge advantages of version control systems is that it gives you a remote place for your code, so you can work on the same codebase from more than one place.
Suppose you are working on a feature with a couple other developers, and a bad winter storm is announced; everybody agrees to go home and keep working rather than get caught in the storm, but nobody is at an ideal stopping place. What do you do?
- Create different branches for each developer and commit your changes to that, push those branches to remote and hope you can clean it up later on remote without making life difficult?
- Create a different
remotejust for incomplete code?
- Copy your code to your personal flash drive and hope you don't lose it later, or get caught violating company policy?
- Something else?
git, but I would hope the answer could be general to any version control system.)