7 Ways to Write Good Commit Message

Hello, I'm a Frontend engineer with a passion for learning new tech, writing blogs, and sharing my knowledge with others.
Apart from coding, I love staying up-to-date with the latest trends and tools in the tech industry. I'm always learning and exploring new technologies and techniques to improve my work and create more efficient and scalable solutions.
I enjoy sharing my knowledge with others through writing blogs and creating courses. Recently, I created a course for Educative on React.
As a freelancer, I'm seeking projects related to Shopify and React. I enjoy working on projects that challenge me and help me grow as a developer.
What is a commit message?
Brief description of the changes you made to the codebase. So that other members of the team can understand all changes you made to the codebase.
Why is it necessary to write a good commit message?
It is a good habit to write a good commit message because people come and go but code remains there. So you should commit in such a way that future members and the member of other teams can understand What all changes you have made?
Let's see an example of the GOOD & BAD Commit message.
- Example1

- Example 2

Points to remember while writing Commit message :
Divide the commit message into 2 parts: subject and body. In the above Example 2 1st message is subject part and 2nd message is body part.
Mention the type of commit you are making in Subject part such as:
- Feat: For any new feature
- Fix: If you fix any bug
- Docs: Changes in documentation
- Style: Any changes in style like color, design etc.
- Refactor: When you refactor the code
- Test: Anything related to testing
- Chore: Regular code maintenance
Limit the subject line to 50 characters.
- Don't end the subject line with a period (.)
Use the Imperative mood in subject line
Imperative mood is like giving orders. Like:
- Fix the bug
- Change background color
Wrap the body part at 72 characters.
Capitalize the subject line and each paragraph.
That's all for this blog. We will meet in the next blog until then Keep learning, Keep growing.
Connect with me :
Reference :
FreeCodeCamp
Neogcamp






