Ask HN: How to commit properly when starting out a project?
When I am just starting out a new project, usually I work on multiple things at once, like (in a web project) the routes, authentication, database models, etc. etc. So usually during the first few days of a project I don't commit at all and just keep adding new code. The result is that when I do commit 5 days down the line it's just a single "Bring the project up-to-date" commit that just pushes everything at once. What is the best practice for committing when just starting out a project? What do you recommend?
5 comments
[ 6.0 ms ] story [ 28.7 ms ] threadJust ship the code, your time matters more than a few fancy commit messages.
Right now, I wouldn't work for 5 days without a single commit. Those "best practices" were invented to address concrete problems.
My advice is not to worry about commit history when you are starting. But definitely try to commit as often as possible. Group changes in logical chunks. Try to use meaningful commit titles and messages.
Not committing anything and losing it all by accident because you're obsessing about micro-commits and a clean history that nobody is ever going to read is a much worse alternative.
Small commits and good descriptions become useful once you have some foundation that's not in a high state of flux and you need to track what change broke something. You don't need this at the draft stage.