Skip to content

Instantly share code, notes, and snippets.

@tomgco
Last active January 3, 2016 03:38
Show Gist options
  • Save tomgco/8403043 to your computer and use it in GitHub Desktop.
Save tomgco/8403043 to your computer and use it in GitHub Desktop.
Git Commit Guidlines

COMMIT

Make sure git knows your name and email address:

$ git config --global user.name "J. Random User"
$ git config --global user.email "[email protected]"

Writing good commit logs is important. A commit log should describe what changed and why. Follow these guidelines when writing one:

  1. The first line should be 50 characters or less and contain a short description of the change; (optionally) prefixed with the name of the changed subsystem (e.g. "pliers: add db dump and restore tasks for sites.").
  2. Keep the second line blank.
  3. Wrap all other lines at 72 columns.

A good commit log looks like this:

subsystem: explaining the commit in one line

Body of commit message is a few lines of text, explaining things
in more detail, possibly giving some background about the issue
being fixed, etc etc.

The body of the commit message can be several paragraphs, and
please do proper word-wrap and keep columns shorter than about
72 characters or so. That way `git log` will show things
nicely even when it is indented.

Fixes issue #1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment