- What is a conventional commit?
- A commit message following the format: type(scope): subject — e.g., feat(auth): add OAuth2 login. Types include feat, fix, docs, style, refactor, test, chore. BREAKING CHANGE in the body/footer triggers a MAJOR semver bump.
- Why enforce commit message format?
- Structured commit messages enable automated changelog generation, semantic versioning, and release notes. They also make git blame, bisect, and log much more useful for debugging — a 3-month-old commit with a clear message saves hours.
- Should I squash commits before merging?
- Squashing (combining multiple commits into one) keeps the main branch history clean. Merge without squashing preserves granular history. GitHub's 'Squash and Merge' option is the most common approach — it produces one clean commit per PR.