If you are one of them, this post will give you a clear idea of industry best practices. Often, we write commit messages like this:
"fixed bug"
"update code"
"minor changes"
But later, when we look back at the commit history, it becomes a headache trying to figure out what actually changed in which commit.
Instead, we can write much more clearly using a structured format:
"feat: add user authentication"
"fix: resolve login validation bug"
"refactor: improve API response handling"
What do "feat," "fix," and "refactor" actually mean?
These are known as Commit Types. Using them makes your commit messages instantly understandable. Here are some of the most common types:
feat → When adding a new feature.
fix → When fixing a bug.
refactor → Changing the code structure without adding new features or fixing bugs.
docs → Updating documentation (like the README).
style → Changes to formatting or code style (no logic changes).
test → Adding or updating tests.
Writing commits this way makes your project history significantly cleaner and ensures that any other developer—or even your future self—can easily understand your work.
Top comments (0)