The goal is to keep the codebase clear and organized, making collaboration easier and ensuring we can understand changes in the future.
- Branch names and commit messages in lowercase: Keeps things uniform and organized.
- Short and clear commit messages: If a commit needs too much explanation, it might need to be split.
- Max 72 characters for the title: If you need more detail, use the extended description.
- One commit, one purpose: Group similar changes into a single commit. If you worked on different things, create multiple commits.
Use the following structure when naming branches so everyone understands the purpose:
Format:
<prefix>/<short-description>
Main Prefixes:
- feat/ – New features.
- fix/ – Bug fixes.
- remove/ – Deleting files or features.
- docs/ – Documentation updates.
- style/ – Visual or formatting changes (no logic adjustments).
- refactor/ – Code restructuring without changing functionality.
- perf/ – Performance improvements.
- test/ – Adding or updating tests.
- build/ – Changes to the build system or dependencies.
- ci/ – Continuous integration changes.
- chore/ – Maintenance and routine tasks.
feat/user-authentication
fix/cart-error
docs/api-endpoints
style/navbar-icons
Commit Format:
<type>: <what you did>
Main Types:
- feat – New feature.
- fix – Bug fix.
- docs – Documentation update.
- style – Formatting or appearance changes.
- refactor – Code restructuring without functional changes.
- perf – Performance optimizations.
- test – Add or update tests.
- build – Dependency or build tool updates.
- ci – CI/CD changes.
- chore – Maintenance tasks.
- update – Maintenance without functional changes (no code).
- Be clear and direct: Write commits that explain exactly what was done.
- Use present tense: "add email validation" instead of "added email validation".
- Avoid confusing or temporary commits: If it's not ready, keep it in your local branch or create a specific branch for it.
feat: implement product search
fix: resolve payment form validation
docs: update API sections
style: adjust margins on header
A clean commit history makes code reviews, collaboration, and troubleshooting faster and more efficient. Having a standard ensures the whole team moves in the same direction, saving time and preventing miscommunication.
By sticking to these guidelines, you contribute to the project's long-term quality and success. If you have suggestions to improve this guide, feel free to share, and we’ll adjust it together.
🚀 Let’s keep moving forward with clarity and organization!