git-guides

Guidelines and rules for Git in my repositories.


Project maintained by mfederczuk Hosted on GitHub Pages — Theme by mattgraham

2.2 Commit Messages

Previous: Commit Contents, Up: Commits   [Contents]

There are some well established conventions for Git messages. A good summary of them can be found here.

It’s also best practice to use an actual editor instead of the -m option.
The commit message editor can be changed by using:

git config --global core.editor "<your editor here>"

A message should not be just a reference to an issue that gets fixed, i.e.: don’t do this:

Fix issue #123

The message should still describe what got fixed and should just reference the issue that gets resolved at the end of the body.

Fix this and that problem

Closes issue #123.

A lengthy description of what changed and why the change was made is not necessary since the referenced issue will already have described why the problem needs to be fixed.