Skip to content

Instantly share code, notes, and snippets.

@sjehutch
Created January 29, 2018 13:48
Show Gist options
  • Save sjehutch/d1f43b2fd881aff4571871e7238a8e78 to your computer and use it in GitHub Desktop.
Save sjehutch/d1f43b2fd881aff4571871e7238a8e78 to your computer and use it in GitHub Desktop.
Commit Guidelines

Commit Guidelines

We like commits to be clear, concise and easy to review. To achieve this, keep your commits as small and specific as possible.

For a discussion on the importance of good commit messages, please see this article.

When writing commit messages follow these rules:

  • Use the present tense ("Add feature" not "Added feature")
  • Use the imperative mood ("Move file to..." not "Moves file to...")
  • Do not add full stops to the end of the first line of the commit message
  • Limit the first line to 72 characters or less, 50 or less is ideal
    • More information or explanation may be added after an empty line, however the first line should always adequately summarize the change made
  • Do not reference issues/pull requests in commit messages
    • The only exception is the automatic reference inserted by GitHub when squashing/merging a pull-request

If you are having trouble writing a succinct commit message, or if it includes the word 'and', consider splitting the commit into smaller ones.

Emoji Styleguide

Consider selecting an emoji for each of your commits (based on Atom's emoji styleguide).

Examples:

  • πŸ› :bug: - Bug fixes
  • πŸ“ :memo: - Adding docs
  • πŸ”₯ :fire: - Removing code
  • πŸ“¦ :package: - Adding new packages
  • πŸ’š :green_heart: - Fixes CI Build
  • 🎨 :art: - Adding UI components
  • βœ… :white_check_mark: Adding or modifying tests
  • ✨ :sparkles: - Adding a new feature
  • 🚧 :construction: - Refactor
  • πŸ’„ :lipstick: - Cosmetic changes to code style
  • πŸ“ :triangular_ruler: - Pixel perfect changes to UI

Note that GitHub might use the pull request title as commit message for the squashed commit. In that case, edit the message to include an appropriate emoji before squashing.

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