Git Commit Message StyleGuide

emoji GitHub contributors GitHub stars license ghit.me

TOC

About

This is an attempt to standardize the format of commit messages, for the sake of uniformity in git log, best practices for writing commit messages & fun!

Using emojis at the beginning of commit messages, other than being fun, provides a simple way to indicate the intention of that commit, an ease for the eyes when browsing/reviewing git log. It's also a simple measure of the fact that how much that commit is focused on a single purpose, which is a good practice.

If these rules and/or using emojis is an overkill for your productivity or simply losing its purposes, please tailor them to your needs or don't use them.

Commit Message Format

All Git Commit Messages MUST meet with this Text Format:

:emoji1: :emoji2: Subject
(Only One NewLine)
Message Body
(Only One NewLine)
Ref <###>

Rules

  1. Capitalize the Subject.
  2. Do not end the Subject line with a period.
  3. Message Subject SHOULD Begin with at-least One Emoji(see below for list of Suggested Emojis).
  4. Message Body SHOULD End with at-least One Issue Tracking ID Reference(GitHub Issues/GitLab Issues/Phabricator Tasks), Ex. Issue #27, Ref T27 or Ref T27, T56 or Fixes T8.
    It's also recommanded to use Full URL to Issues, instead of just Issue ID Number; Doing so will ease browsing issues from terminal.
  5. Total Characters of the Subject Line MUST be Less than or Equal to 50 Chars Long.
  6. Wrap the Message body at 72 characters.
  7. Use Valid MarkDown format in Message Body.
  8. Use the Present Tense ("Add feature" not "Added feature").
  9. Use the Imperative Mood ("Move cursor to..." not "Moves cursor to...").
  10. Use the Message body to explain what and why vs. how.
  11. All WIP(Work In Progress) Commits MUST have the WIP Emoji(see below).

Notes

  • All WIP Commits Should be Avoided!.
  • Refrencing Issues by using special keywords like Fixes or Resolves will mark them as closed automatically! For more information about automatic issue closing using ketwords see: GitHub/GitLab/Phabricator.
  • There is a Space Character between Multiple Emojis!.
  • There is NO New-Line After the Task ID Reference Line.
  • Every Raw Emoji Text(:emoji:) is Counted as One Char!.
  • See ToDo Grammar StyleGuide for more Information on @XXX Comment Tags.

Suggested Emojis

Emoji Raw Emoji Code Description
🎨 :art: when improving the format/structure of the code
📰 :newspaper: when creating a new file
📝 :pencil: when performing minor changes/fixing the code or language
🐎 :racehorse: when improving performance
📚 :books: when writing docs
🐛 :bug: when reporting a bug, with @FIXMEComment Tag
🚑 :ambulance: when fixing a bug
🐧 :penguin: when fixing something on Linux
🍎 :apple: when fixing something on Mac OS
🏁 :checkered_flag: when fixing something on Windows
🔥 :fire: when removing code or files, maybe with @CHANGED Comment Tag
🚜 :tractor: when change file structure. Usually together with 🎨
🔨 :hammer: when refactoring code
:umbrella: when adding tests
🔬 :microscope: when adding code coverage
💚 :green_heart: when fixing the CI build
🔒 :lock: when dealing with security
⬆️ :arrow_up: when upgrading dependencies
⬇️ :arrow_down: when downgrading dependencies
:fast_forward: when forward-porting features from an older version/branch
:rewind: when backporting features from a newer version/branch
👕 :shirt: when removing linter/strict/deprecation warnings
💄 :lipstick: when improving UI/Cosmetic
:wheelchair: when improving accessibility
🌐 :globe_with_meridians: when dealing with globalization/internationalization/i18n/g11n
🚧 :construction: WIP(Work In Progress) Commits, maybe with @REVIEW Comment Tag
💎 :gem: New Release
🥚 :egg: New Release with Python egg
🎡 :ferris_wheel: New Release with Python wheel package
🔖 :bookmark: Version Tags
🎉 :tada: Initial Commit
🔈 :speaker: when Adding Logging
🔇 :mute: when Reducing Logging
:sparkles: when introducing New Features
:zap: when introducing Backward-InCompatible Features, maybe with @CHANGED Comment Tag
💡 :bulb: New Idea, with @IDEA Comment Tag
❄️ :snowflake: changing Configuration, Usually together with 🐧 or 🎀 or 🚀
🎀 :ribbon: Customer requested application Customization, with @HACK Comment Tag
🚀 :rocket: Anything related to Deployments/DevOps
🐘 :elephant: PostgreSQL Database specific (Migrations, Scripts, Extensions, ...)
🐬 :dolphin: MySQL Database specific (Migrations, Scripts, Extensions, ...)
🍃 :leaves: MongoDB Database specific (Migrations, Scripts, Extensions, ...)
🏦 :bank: Generic Database specific (Migrations, Scripts, Extensions, ...)
🐳 :whale: Docker Configuration
🤝 :handshake: when Merge files

Tools

  • Commit(CLI): This is a nifty CLI tool to aid in standardizing commit messages based on this document, thanks to @jakeasmith.
  • gitMoji(Chrome Extension): Enhance your commits with emojis!, thanks to @louisgrasset.

Contributing

Ask to Be Creative!

To add a new Emoji to the list: Create an Issue & Send a PR.

License

The Code is licensed under the MIT License.