Commits are cheap

When using a version control system, such as Git, commits are quick and cheap.

I like to make small commits as often as possible whilst working on a task.

For example, when doing test-driven development, I commit my changes wherever the tests are passing or after a refactor.

Each commit is a checkpoint I can easily roll back to if needed.

I've never regretted making a commit, but I've regretted not making one.

Commits are cheap, but debugging without a recent commit is expensive.