4  Good Commits

5 Commit Granularity

Each commit should encapsulate a single logical change:

  • Add a new analysis script.
  • Fix a bug in data cleaning.
  • Update manuscript text.
  • Revise a figure caption.

Avoid mixing unrelated changes (e.g. updating a script and editing the manuscript) in one commit.
Smaller commits improve clarity and make rollbacks safer.

6 Commit Examples

Here are good commit messages:

  • Add mixed-effects model for content trust
  • Clean missing data handling in pilot dataset
  • Write introduction for trust study manuscript
  • Export SEM diagram with significance stars

These describe both the change and its purpose.
When in doubt, err on the side of more commits with more detail.