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 trustClean missing data handling in pilot datasetWrite introduction for trust study manuscriptExport 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.