Git Commits
Overview
Conventional commit messages and safe git workflows. Covers commit format rules, staging discipline, disaster recovery, and commit examples.
Quick Reference
Format
type(scope): description
Body (optional, blank line required)
Types
| Type | Version Bump | Usage |
|---|---|---|
upgrade |
MAJOR | Breaking changes |
feat |
MINOR | New features |
fix |
PATCH | Bug fixes |
perf |
PATCH | Performance improvements |
revert |
PATCH | Reverting changes |
docs |
NONE | Documentation |
style |
NONE | Formatting, white-space |
refactor |
NONE | Code restructuring |
test |
NONE | Adding/fixing tests |
chore |
NONE | Tooling, config |
ci |
NONE | CI/CD changes |
Safe Staging Rules
- Stage by context — never
git add .blindly - Check old imports with
grepbefore moving files - Use
git add -uto include deleted files git stashbefore anygit reset --hard- Small frequent commits over one giant commit
References
- Commit Format — Format rules, types, scope
- Safe Git Workflow — Staging safety, disaster recovery, reflog
- Commit Examples — Real commit examples by type
- Quick Reference — Cheat sheet