Git commit messages
Writing clear and concise git commit messages is important to the overall health of a project and the team that is working on the project.
Good commit messages have 3 critical benefits:
    1.
    Help speed up the code review process
    2.
    Help in writing good release notes
    3.
    Help future maintainers (and your future self) understand why a change was made, or what exactly a particular bug was

Sample commit message

1
Short (70 chars or less) summary of changes
2
3
More detailed explanatory text, if necessary. Wrap it to about 80
4
characters or so. In some contexts, the first line is treated as the
5
subject of an email and the rest of the text as the body. The blank
6
line separating the summary from the body is critical.
7
8
Further paragraphs come after blank lines.
9
- Bullet points are okay, too
10
- A hyphen is used for the bullet, surrounded by a single space
Copied!
    The summary line is written in the imperative voice, and is structured in a way so that the message completes the sentence, “If applied, this commit will…”. For eg:
      "Split the Rx streams in RecentPatientsViewController"
      "Add Appium checkstyle task to the git pre-push hook"
      "Add query in PatientRepository to get count of sync-pending records"
    Summary lines start with words like “Add”, “Update”, and “Fix” instead of Added, Updated and Fixed
    Summary lines never end with a period, just like the subject of an email
    The explanatory text isn’t required but encouraged, especially when a commit fixes a bug. It’s good practice to explain clearly why a certain issue was occurring and how the commit fixes it.
Last modified 1yr ago
Copy link