### Write Good Commit Messages
[[Elements of a Good Commit Message]]
The purpose of a commit message is to communicate context about a change to fellow developers (and your future self). An insightful and well-structured commit message can save a lot of time when diagnosing issues or understanding the rationale behind a particular code change. Here are some general guidelines:
- The first line of your commit message should be a concise summary that's no longer than 50 characters
- Add a new line and a longer description if necessary, which can be formatted using paragraphs.
- If your commit has multiple changes that require listing, use bullet points in the detailed description.
- Write your commit message in the imperative, as if you are giving a command. ("Add feature" not "Added feature" or "Adds feature").
- Skip the period at the end of the commit summary.
#### Here's a Good Commit Structure:
```
Summarize changes in around 50 characters or less
More detailed explanatory text, if necessary. This should be wrapped at
around 72 characters. The blank line separating the summary from the body
is critical (unless omitting the body).
Explain the problem the commit is solving. Focus on why you are making
this change as opposed to how (the code explains that).
If there are any related issues or tickets, reference them here.
- Bullet points are okay, too
- Typically a hyphen or asterisk is used for the bullet, followed by a
single space, with blank lines in between.
```
#### Here's an Example:
```
Optimize image loading for faster page performance
The previous method of loading images was inefficient, causing a noticeable
lag in page load times, especially on slower connections. Users on our forum
and through feedback forms reported sluggish behavior when accessing the
website's gallery section.
This commit introduces:
- Compressed versions of images to reduce file size without compromising quality.
- Lazy loading for off-screen images to ensure they only load when they're
about to be viewed.
- Removal of redundant image metadata to further reduce the image size.
Related issues: #456, #789
- Tested on both desktop and mobile views
- Checked with different connection speeds, including 3G mobile.
```