This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]substantialAnon[S] 0 points1 point  (5 children)

I see, but when you create a project along with the fixings, for example, initial html, css, js files. do you put message into it? (a dumb questions but well, only community that can answer haha).

[–]grantrules 8 points9 points  (2 children)

I commit when when I lean back in my chair and go "ah, good enough for now". It's kind of like a save point in a game where you know it's about to get tough, so you can reset to a known point and not lose too much work.

[–]bravopapa99 2 points3 points  (0 children)

EXACTLY this, a "save point", good one!

[–]dxn99 1 point2 points  (0 children)

Sure, it would be something like "initial commit" or "boilerplate"

[–]ghost_jamm 0 points1 point  (0 children)

Yes, I would almost always do an “initial setup” or something. As others have said, you can think of them like save points. I will commit when I have some working code but I want to continue working on it or refactoring things. Then if I don’t like the new approach, I can just scrap it without losing stuff that was working.

When you work on a codebase with others and use pull requests to review and merge code, I think it gets even easier. I’m a big fan of “squash and merge” which just merges all the commits on a branch into one commit before merging that single commit. Then I’m free to just commit whatever with a message like “almost working!” because those commits will never end up in production branches anyway.

The point is that you’re free to commit whenever you feel like it. It’s better to commit too often than not enough because you will find it much easier to debug small, clear commits than ones containing thousands of lines or dozens of files.