Commit Guidelines
Writing clear and meaningful commit messages helps your team understand the history of changes and improves collaboration.
1. Use the Conventional Commit Format (Optional but Recommended)β
<type>(optional): <short summary>
Exampleβ
feat: add JWT-based login
fix: correct button alignment on mobile
Common types:
feat: new featurefix: bug fixdocs: documentation onlystyle: formatting, missing semi colons, etc.ref: code change that neither fixes a bug nor adds a featuretest: adding or fixing testschore: maintenance tasks
2. Write Clear and Concise Messagesβ
- Use the imperative mood: βAdd featureβ not βAddedβ or βAddsβ.
- Keep the summary under 50 characters.
- Use the body (optional) to explain why the change was made, not just what.
3. Reference Issues or PRsβ
Link related issues or pull requests to provide context.
fix: handle token expiration
Fixes #123
4. Examplesβ
feat: add endpoint for user registration
This adds a new POST endpoint at /api/register to allow users to sign up.
Includes validation and error handling.
Closes #42
docs: update installation instructions
chore: update dependency eslint to v8.10.0
chore: add codeowners file
chore: update CI workflow to use Node.js 18
chore: clean up unused scripts
chore: reformat code with prettier
This type of commit is used for routine tasks such as updating dependencies, configuration files, or build scripts that do not affect the application's functionality.
π‘ Tipsβ
- Use a linter like Commitlint to enforce commit message format.
- Squash commits before merging to keep history clean.