How big should a commit be?
One logical change that builds and passes tests on its own. Small, focused commits are easier to review, revert, cherry-pick and bisect than a giant commit mixing several unrelated things.
Explain it simply
Think of a bill split item by item rather than one lump sum. If one item is wrong, you dispute only that line.
A good commit does one job: rename a function, add a validation, fix a bug. If you cannot describe it in one short sentence without 'and', split it. Small commits let you revert only the bad part, let bisect find bugs precisely, and make reviews less tiring. But do not go to extremes with commits that break the build. Use git add -p to split mixed edits.
Example
git add -p # pick hunks for the first logical change
git commit -m "Validate pin code length"
git add -p # next change
git commit -m "Rename getUser to fetchUser"What to say in the interview
"A commit should be one logical, working change that I can describe in a single sentence. Small focused commits are easier to review, revert and bisect, and git add -p helps me split mixed edits."