🚀 Clean Commit Messages: Why & How

Writing clear, structured commit messages makes collaboration smoother, code reviews easier, and project history understandable. Here’s a simple guide I follow:⁣

Commit Message Structure⁣

<type>(<scope>): <short descrip…


This content originally appeared on DEV Community and was authored by Mhammed Talhaouy

Writing clear, structured commit messages makes collaboration smoother, code reviews easier, and project history understandable. Here's a simple guide I follow:⁣

Commit Message Structure


<type>(<scope>): <short description>⁣



  • type → the kind of change⁣
  • scope → optional, the affected module⁣
  • description → concise summary (imperative mood)⁣ ⁣ ### Common Types⁣ ⁣
  • feat: → new features⁣
  • fix: → bug fixes⁣
  • chore: → maintenance, build updates, configs⁣
  • docs: → documentation⁣
  • refactor: → code improvements without changing behavior⁣
  • style: → formatting, linting, whitespace⁣
  • test: → adding/updating tests⁣ ⁣ Example:⁣ ⁣
feat(auth): add login with Google⁣
fix(api): handle null pointer on user fetch⁣
chore: update dependencies⁣



Best Practices

  1. Imperative tone – describe what the commit does:⁣ ✅ fix(ui): remove extra padding on button⁣ ❌ fixed padding issue⁣ ⁣
  2. Keep subject short – ≤ 50 characters⁣ ⁣
  3. Use body for details – explain why, not just what:⁣ ⁣
   feat(auth): add password reset⁣
⁣
   - Added endpoint /auth/reset-password⁣
   - Updated email templates⁣
   - Closes #123⁣




Clean commits = better teamwork & smoother code history! 🛠️💡⁣


This content originally appeared on DEV Community and was authored by Mhammed Talhaouy


Print Share Comment Cite Upload Translate Updates
APA

Mhammed Talhaouy | Sciencx (2025-09-26T11:11:43+00:00) 🚀 Clean Commit Messages: Why & How. Retrieved from https://www.scien.cx/2025/09/26/%f0%9f%9a%80-clean-commit-messages-why-how/

MLA
" » 🚀 Clean Commit Messages: Why & How." Mhammed Talhaouy | Sciencx - Friday September 26, 2025, https://www.scien.cx/2025/09/26/%f0%9f%9a%80-clean-commit-messages-why-how/
HARVARD
Mhammed Talhaouy | Sciencx Friday September 26, 2025 » 🚀 Clean Commit Messages: Why & How., viewed ,<https://www.scien.cx/2025/09/26/%f0%9f%9a%80-clean-commit-messages-why-how/>
VANCOUVER
Mhammed Talhaouy | Sciencx - » 🚀 Clean Commit Messages: Why & How. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/09/26/%f0%9f%9a%80-clean-commit-messages-why-how/
CHICAGO
" » 🚀 Clean Commit Messages: Why & How." Mhammed Talhaouy | Sciencx - Accessed . https://www.scien.cx/2025/09/26/%f0%9f%9a%80-clean-commit-messages-why-how/
IEEE
" » 🚀 Clean Commit Messages: Why & How." Mhammed Talhaouy | Sciencx [Online]. Available: https://www.scien.cx/2025/09/26/%f0%9f%9a%80-clean-commit-messages-why-how/. [Accessed: ]
rf:citation
» 🚀 Clean Commit Messages: Why & How | Mhammed Talhaouy | Sciencx | https://www.scien.cx/2025/09/26/%f0%9f%9a%80-clean-commit-messages-why-how/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.