viphat / til

Today I Learned
http://notes.viphat.work
0 stars 1 forks source link

How do I write a good commit message? And why should I care? #288

Open viphat opened 6 years ago

viphat commented 6 years ago

Here are some important things to think about when crafting a good commit message:

Do

Don't

The best way that I've found to come up with a commit message is to finish this phrase, "This commit will...". However, you finish that phrase, use that as your commit message.

Above all, be consistent in how you write your commit messages.

Explain the Why

If you need to explain why a commit needs to be made, you can!

When you're writing the commit message, the first line is the message itself. After the message, leave a blank line, and then type out the body or explanation including details about why the commit is needed. (e.g. URL links)

This details section of a commit message is included in the git log. Only the message (the first line) is included in git log --one-line

viphat commented 6 years ago

https://udacity.github.io/git-styleguide/ - Udacity Git Style Guide