Skip to content
osehr-agent edited this page Mar 4, 2013 · 3 revisions

Good Practices

This page documents good practices to follow when using Git.

Commit Messages

  • Format commit messages as follows:

    • Write a one-line summary of the change on the first line. Treat this like an email subject line.
    • Leave a blank second line.
    • Write a free-form explanation of the change. Treat this like an email message body.
    • Optionally leave a final blank line followed by one or more "footer" lines of the form Key: Value to hold structured information.
  • Write commit messages in imperative mood, e.g. "Add X" instead of "Adds X", "Adding X", or "Added X".

  • Here is an example:

    CONTRIBUTING: Add a concrete, imperative commit message example
    
    Without this contributors must imagine how to write a commit
    message based on a description rather than an example.
    
    Write a commit message like one would write an email instructing
    someone else to make the change.  Summarize the change in a brief
    subject line at the top.  Describe the change in imperative mood in
    the message body.  Cover the motivation and how the patch works.
    
    After the last paragraph, leave a blank line and then add footer
    lines of the form "Key: Value" to, for example, reference an
    issue tracker entry.
    
    Issue-Id: 99999
    
  • See also A Note About Git Commit Messages.

Clone this wiki locally