Lazy Commit
Create atomic commits for each logical change with conventional commit messages.
Commit Process
- •
Assess state
bashgit status --porcelain git diff --stat git diff --cached --stat
- •
Analyze changes
bashgit diff git diff --cached
- •Review content of each change
- •Identify related changes that belong together
- •
Group into logical commits
- •Each commit = ONE logical change
- •Related files committed together
- •Order: dependencies first, then dependents
- •
Create commits
bashgit add <specific-files> git commit -m "<type>: <brief description>"
Conventional Commit Types
| Type | Use |
|---|---|
feat: | New feature |
fix: | Bug fix |
refactor: | Code restructuring (no behavior change) |
docs: | Documentation |
style: | Formatting (no code change) |
test: | Tests |
chore: | Maintenance, deps, config |
Message Guidelines
- •Under 72 characters
- •Imperative mood ("add" not "added")
- •Specific but concise
- •No period at end
Examples:
- •
feat: add user authentication endpoint - •
fix: resolve null pointer in config parser - •
refactor: extract validation logic to separate module
Push (Optional)
Only push if explicitly requested:
bash
git push origin <current-branch>