GitScroll #005

Commit with intent.

A commit should capture one coherent decision and explain why it exists.

All scrolls

Interpretation

A useful commit is smaller than a feature but larger than a keystroke. It leaves the repository in a valid state and gives reviewers a coherent unit of thought. The message supplies the reason that the diff cannot: what changed in understanding, behavior, or constraint.

Practice

  • Separate mechanical changes from behavioral ones.
  • Write the message for the teammate investigating six months later.
  • Run the relevant checks before committing.

Anti-pattern

One “misc fixes” commit containing formatting, renames, and behavior changes.