Commit Discipline
Prerequisites
Only commit when ALL conditions are met:
- •All tests are passing
- •All compiler/linter warnings resolved
- •Change represents a single logical unit of work
Commit Message Format
Clearly state whether the commit contains:
- •
[structural]- Renaming, extracting, moving code (no behavior change) - •
[behavioral]- New features, bug fixes, logic changes
Examples:
code
[structural] Extract validation logic to separate method [behavioral] Add user email validation
Best Practices
- •Use small, frequent commits rather than large, infrequent ones
- •Never mix structural and behavioral changes in the same commit
- •Run tests before committing
Workflow
- •Run all tests
- •Check for linter warnings
- •Review staged changes
- •Write clear commit message with type prefix
- •Commit