Writing a meaningful subject

The subject of a commit is the most important part: its role is to make clear what the commit contains. Avoid technical details of other things - a common developer can understand opening the code, and focus on the big picture: remember that every commit is a sentence on the repository history. So, wear the hat of the changelog reader and try to write the most convenient sentence for him, not for you: use present tense, and write a 50 chars max sentence.

A good subject is one like this: "Add the newsletter signup in homepage".

As you can see, I used the imperative past tense and, more importantly, I didn't say what I had done, but what the feature does: it adds a newsletter signup box to my website.

The 50-char rule is due to the way you use Git from the shell or GUI tools; if you start to write long sentences, reviewing logs and so on can become a nightmare. So, don't try to be the Stephen King of commit messages: avoid adjectives and get straight to the point, you can then go more in-depth in the additional details lines.

One more thing: start with capital letters, and do not end sentences with periods - they are useless, and even dangerous.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.235.104