Skip to main content

Commit Guidelines

Writing clear and meaningful commit messages helps your team understand the history of changes and improves collaboration.


<type>(optional): <short summary>

Example​

feat: add JWT-based login
fix: correct button alignment on mobile

Common types:

  • feat: new feature
  • fix: bug fix
  • docs: documentation only
  • style: formatting, missing semi colons, etc.
  • ref: code change that neither fixes a bug nor adds a feature
  • test: adding or fixing tests
  • chore: 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.