Skip to content

Instantly share code, notes, and snippets.

@avatar-lavventura
Last active February 13, 2026 11:35
Show Gist options
  • Select an option

  • Save avatar-lavventura/0d8dcd8c97fe92f2306db3c737eede51 to your computer and use it in GitHub Desktop.

Select an option

Save avatar-lavventura/0d8dcd8c97fe92f2306db3c737eede51 to your computer and use it in GitHub Desktop.
1. `Separate subject from body with a blank line`
2. `Limit the subject line to 50 characters`
3. `Capitalize the subject line`
4. `Do not end the subject line with a period`
5. `Use the imperative mood in the subject line`
6. `Wrap the body at 72 characters`
7. `Use the body to explain what and why vs. how`
Fix typo in introduction to user guide
Mark huge records as obsolete when clearing hinting faults
Refactor subsystem X for readability
Update getting started documentation
Remove deprecated methods
Release version 1.0.0
Subject line should always be able to complete the following sentence:
If applied, this commit will `your subject line here`
If applied, this commit will refactor subsystem X for readability
If applied, this commit will update getting started documentation
If applied, this commit will remove deprecated methods
If applied, this commit will release version 1.0.0
If applied, this commit will merge pull request #123 from user/branch
Example-1:
Summarize changes in around 50 characters or less
More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of the commit and the rest of the text as the body. The
blank line separating the summary from the body is critical (unless
you omit the body entirely); various tools like `log`, `shortlog`
and `rebase` can get confused if you run the two together.
Explain the problem that this commit is solving. Focus on why you
are making this change as opposed to how (the code explains that).
Are there side effects or other unintuitive consequences of this
change? Here's the place to explain them.
Further paragraphs come after blank lines.
- Bullet points are okay, too
- Typically a hyphen or asterisk is used for the bullet, preceded
by a single space, with blank lines in between, but conventions
vary here
If you use an issue tracker, put references to them at the bottom,
like this:
Resolves: #123
See also: #456, #789
Example-2: ------------------------------------------------------
Simplify serialize.h's exception handling
Remove the 'state' and 'exceptmask' from serialize.h's stream
implementations, as well as related methods.
As exceptmask always included 'failbit', and setstate was always
called with bits = failbit, all it did was immediately raise an
exception. Get rid of those variables, and replace the setstate
with direct exception throwing (which also removes some dead code).
As a result, good() is never reached after a failure (there are
only 2 calls, one of which is in tests), and can just be replaced
by !eof().
fail(), clear(n) and exceptions() are just never called. Delete
them.
Link: https://chris.beams.io/posts/git-commit
Source http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment