Skip to content

Instantly share code, notes, and snippets.

@gabitoesmiapodo
Last active April 12, 2024 19:49
Show Gist options
  • Save gabitoesmiapodo/ff954a01bf18bb85c7ad834137052b46 to your computer and use it in GitHub Desktop.
Save gabitoesmiapodo/ff954a01bf18bb85c7ad834137052b46 to your computer and use it in GitHub Desktop.
Suggested commit message format

Some simple rules:

  • Add a summary or title: Aim for about 50 characters. It's a title, not a novel.
  • Use the imperative mood for the summary: It's like giving a command or instruction. Examples: "Fix bug" or "Add feature", not "Fixed bug" or "Adding feature".
  • Explain the "why", not the "how" in the body / description: If the summary is the action (what you did), the body is the motivation (why you did it). This is your chance to give context or reasoning.
  • Wrap the body at 72 characters / description if possible: Makes the message readable without having to scroll horizontally in a terminal.
  • Reference issues and pull requests liberally: Got a ticket number? Include that in the body. It's about making life easier for whoever is digging through history later.

Commit message examples:

Feat: add search functionality to the user dashboard

Implemented a new search bar in the dashboard that allows users to search through their
past transactions quickly. Utilized Elasticsearch for efficient, real-time search results.

Part-of: #456
Refactor: subsystem X for readability

- Split the subsystem into logical components
- Increase code readability in module Y
- Address performance issues identified in benchmarks

Resolves: #123
See-also: #456, #789
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment