Git plays a very important role in software development. It allows for collaboration across the globe. In such an ecosystem, git commits must show what the other developer's thought process was while working. Maybe that other developer is your self from 3 months back.
- The
titlemust start with a capital letter unless it is an identifier. - The
bodyand thetitlemust be separated by 2 blank lines. - The
titleshould not end with a period. - Each line in the body shouldn't exceed 75 characters.
- Use the imperative form of verbs (
AddnotAdded,RemovenotRemoved). - The
titleshouldn't exceed 72 characters. - The commit's
bodymust explain the entire thought process behind the changes or further details. - Your git commit must have a
titlethat briefly sums up the changes made to the codebase.
You could visit any successful open source project and view their git commits.
For example, this commit is a good example of a well-written commit.
I would like to quote what Atom says in their contributing guidelines.
These are mostly guidelines, not rules. Use your best judgment.
This is a summary of these resources:
Gnome guidelines
Atom guidelines
I highly encourage to read these. 😄
| Photo by Yancy Min on Unsplash
Top comments (0)