🍪 Note: Our web-bootcamp-docs subdomain is a cookie-free zone.
Commit Messages

Guide to Writing Effective Commit Messages

Writing a good commit message is an essential skill for any developer. It's about creating a clear and descriptive history of your project's changes. By following these guidelines, your commit messages will be easy for you and your teammates to understand, making collaboration and project tracking much smoother.

Here are the key principles for writing great commit messages:

  • Be Short and Descriptive:
    Your message should be concise but informative. The goal is to provide a quick summary of what changed.

  • Use English:
    Always write your messages in English to ensure they are universally understood by anyone working on the project.

  • Start with a Verb:
    The first word of your commit message should be a verb that describes the action you took, such as:

    • add
    • fix
    • remove
    • update
    • refactor
  • Use Imperative and Present Tense:
    Write your messages as a command. For example, use "add user authentication" instead of "added user authentication" or "adding user authentication."

  • Avoid Punctuation:
    Do not end your commit message with a period.
  • Explain the "Why," Not Just the "How":
    If you're unsure what to write, focus on explaining why you made a change rather than just how you did it. For example, use "fix incorrect page redirect" instead of "change the URL in the navigation file."

Your commit messages act as a log of all changes to your codebase. When done well, they tell a story that helps other developers quickly understand the project's history and the purpose of each change.