I mentioned commits being too large yesterday. What do I mean by that? Here’s a simple rule of thumb I use: If your commit message includes the word “and,” it’s probably doing too much.
This commit changes x and y
This removes a and b
This updates foo and allows admins to…
Each commit should represent one logical change. If it moves the feature forward in a clear, isolated way, it probably belongs on its own. There’s no real downside to making tiny, incremental commits—especially since you can always squash them later when merging to main.
Of course, if two things are truly one logical change—like renaming a method and updating its uses—that still counts as atomic.
This is where the term “atomic commit” comes from. It encourages each commit to be as small as possible.