DEV Community

Cover image for What is a good message and size for a commit?

What is a good message and size for a commit?

Marcos Junior on March 01, 2024

First of all, why should I have to write a commit message? Git already generates a unique hash, so why is it required? Actually, it is not req...
Collapse
 
fpaghar profile image
Fatemeh Paghar

To summarise
A good commit message should be concise yet descriptive, providing enough information to understand the purpose of the change at a glance. It should follow a clear and consistent format, including a succinct summary of the changes made, along with any relevant contextual details. As for the size of a commit, it's best to follow the principle of atomicity, focusing on solving one specific problem or implementing one feature per commit. This ensures that each commit remains focused and self-contained, making it easier to review, test, and revert if necessary. By adhering to these guidelines, developers can maintain a clean and understandable commit history, facilitating collaboration and code maintenance.

Collapse
 
prafulla-codes profile image
Prafulla Raichurkar

Wow, really helpful! I didn't know we could add emojis in commit messages.

Collapse
 
sindhani profile image
Waheed Sindhani

helpful!
There is a typo in Point 3
typo thirty it should be third

3 . Thirty with 1 new file which are not imported yet

Collapse
 
coderanac profile image
Ana Caroline Campos

I love it! really useful

Collapse
 
pedrop3 profile image
Pedro Santos

Simple and perfect šŸ‘šŸæ

Collapse
 
paulstapel profile image
Paul

Very interesting article. Thanks for sharing it!