Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

A good commit message looks like this:

Header line: 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
74 characters or so. That way "git log" will show things
nicely even when it's indented.

Reported-by: whoever-reported-it
Signed-off-by: Your Name <>

where that header line really should be meaningful, and really should be just one line. That header line is what is shown by tools like gitk and shortlog, and should summarize the change in one readable line of text, independently of the longer explanation.

Copy link

yihangho commented Aug 4, 2013

The link does not point to the correct line. Please update to:

Copy link

yachi commented Dec 16, 2015

Copy link

puzanov commented Jan 26, 2017

huh, seems that all my commits are lame

Copy link

heldrida commented Jan 26, 2017

Most common, say as much as possible with the smallest number of characters:

commit msg: fix

Copy link

antstorm commented Jan 26, 2017

I think all this points out is that you should format your commit messages to make it easier for the various tools to recognise and display properly. Unless there's a specific underlying format (like markdown or similar) it is the tool's job to figure out how to display the commit message

Copy link

manasRK commented Jan 26, 2017

Woah ! Seems one would have to be careful while making commits with minor big fixes.

Copy link

ghost commented Jan 26, 2017


Copy link

orangle commented Jul 11, 2018


Copy link

abhijeetps commented Mar 10, 2019

There's a GitHub bot named DCO which checks if the PR follows this commit style:

Copy link

alexellis commented Oct 20, 2019

Derek also checks DCO and does other useful tasks for projects

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