What is a good commit message?

QuestionsQuestions8 SkillsProGit Config ManagementSep, 13 2025
097

A good commit message should be clear, concise, and descriptive. Here are some guidelines for writing effective commit messages:

  1. Use the imperative mood: Write the message as if you are giving a command. For example, use "Add feature" instead of "Added feature."

  2. Be concise: Keep the message brief, ideally under 50 characters for the summary line. If you need to provide more detail, you can add a longer description in the body.

  3. Explain the why: If necessary, include the reasoning behind the changes in the body of the message. This helps others (and your future self) understand the context.

  4. Reference issues or tasks: If applicable, reference any related issue numbers or tasks to provide additional context.

Example of a good commit message:

Add user authentication feature

This commit implements user login and registration functionality.
It also includes validation for user input and error handling.

By following these guidelines, you can create commit messages that are helpful for anyone reviewing the project history.

0 Comments

no data
Be the first to share your comment!