Big Gains with Small Commits: Good Habits in Development Process

6 min read

The importance of making small commits in software development process, pre-commit checklist and things to consider when working with AI CLI tools.

Big Gains with Small Commits: Good Habits in Development Process

One of the most common mistakes we make in software development is writing code for days and then trying to make one big commit at once. But why is this so wrong and how can we do better?

Small Commits, Big Benefits

Instead of writing code for 5-6 days without making any commits, it makes much more sense to progress in small steps. Here's the ideal process:

  • Make a small development
  • Test it, make sure it works
  • Commit
  • Start your next development with a clean commit state

This approach has many advantages. First of all, you know exactly what you changed at each step. When there's an error, you can easily find which commit it started in. Code review processes also become much easier.

Pre-Commit Checklist

Following these steps before committing is very beneficial:

  1. Check git status - See which files you've changed
  2. Review diffs - Go through each change
  3. Clean up unnecessary code - Check if there are test codes, debug lines you added during development
  4. Make sure you haven't deviated from your purpose - Only the changes you planned should be in that commit

TODO Comments: The Secret to Staying Focused

It happens to us very often during development: while fixing one thing, we notice another problem and want to fix it immediately. At this point, we need to restrain ourselves.

You've made a development, you're getting ready to commit, but suddenly you decide you want to make another development. This is exactly where TODO comments come into play. If you see another problem while developing, don't try to fix it right away. Instead:

// TODO: This part should be optimized - performance issue

Add a comment like this and clean up your current commit. Then tackle that problem as a separate task. This way, each commit has a single purpose and your code history becomes much more readable.

Working with AI CLI Tools

In modern development process, we frequently use AI CLI tools. We can apply similar disciplines when working with these tools:

  • Starting a new AI conversation after each important development step gives cleaner and more focused results
  • Prevents AI from being affected by previous context and provides more stable performance
  • You get a fresh start for each new task

Conclusion

Making small commits is not just a technical habit, it actually changes your way of thinking. You develop the habit of breaking problems into small pieces, checking each step, and writing clean code.

Remember: every commit should tell a story. And the best stories are short, concise, and understandable.

Was this article helpful? You can share your comments via social media.
Other Articles