Skip to content

Instantly share code, notes, and snippets.

@mdrmike
Last active September 20, 2020 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdrmike/560a88af1ad53e574a25ef6ed87cf601 to your computer and use it in GitHub Desktop.
Save mdrmike/560a88af1ad53e574a25ef6ed87cf601 to your computer and use it in GitHub Desktop.
Git commit "best practices" with or without useful github emoji πŸ’₯

commit-emoji

List of emoji for git commits. πŸ’₯

Interesting idea from the Atom.io contributing docs.

Consider starting the commit message with an applicable emoji

This idea was orinially based on Atom.io contrib docs... Though, apparently not in current guide. Other examples are kinda interesting with code available online. Also worth checking out:

Project Commit Emoji's

Be a good collaborator. Communicate the context about a change.
➑️ Read More and more

General Rules

  1. The first word should be an UPPERCASE action label and/or emoji
  2. Then, Capitalize the subject line
  3. Use the imperative mood in the subject line. Fix, Add, Change instead of Fixes, Added, Changing.
  4. Limit the subject line to 50 characters
  5. Do not end the subject line with a period
  6. Separate subject from body with a blank line
  7. Use the body to explain what and why vs. how
  8. Wrap the body at 72 characters

A Good Commit Message Should Answer

  1. Why is this change necessary? It may fix a bug, it may add a feature, it may improve performance, reliabilty, stability, or just be a change for the sake of correctness.
  2. How does it address the issue? For short obvious patches this part can be omitted, but it should be a high level description of what the approach was.
  3. What side effects does this change have? (In addition to the obvious ones, this may include benchmarks, side effects, etc.)

Pro-tip: Format subject line:
<emoji or ACTION:> <50 character synopsis of change>

Table of Commit Emoji

Emoji Markdown Commit action label
BASIC
✨ :sparkles: ADD / feature
πŸ™ˆ :see_no_evil: ADD / UPDATE gitignore
πŸ’© :poop: ADD / poor/quick code
πŸ› :bug: BUGFIX
πŸ”§ :wrench: CHANGE / re-TOOL
πŸš‘ :ambulance: CRITICAL HOTFIX
πŸš€ :rocket: DEPLOY (build)
🌱 🐣 :seedling: :hatching_chick: INIT
πŸ”€ :twisted_rightwards_arrows: MERGE
❌ :x: REMOVE
DETAILED
βž• :heavy_plus_sign: ADD (new api)
🎨 :art: ADD/CHANGE (UI code)
πŸ’„ :lipstick: ADD/CHANGE (cosmetic / lint)
♻️ πŸ—οΈ :recycle: :building_construction: CHANGE (refactor)
🐎 :racehorse: CHANGE (streamline)
⚑ :zap: CHANGE (improve performance)
πŸ“ :memo: DOC
🚚 :truck: MOVE / RENAME
πŸ“› :name_badge: METADATA
©️ :copyright: LICENSE
πŸŽ‰ :tada: INIT ( begin project )
🌐 :globe_with_meridians: INTERNATIONALIZATION
πŸ’€ :skull: REMOVE (depreciate api)
βͺ :rewind: REVERT
❔ :white_check_mark: TEST
:shipit: :shipit: VERSION
🚧 :construction: WIP

Example

Shell Command Result
git commit -m ":bug: BUGFIX: Foo bar baz ipsum blah in lorem" πŸ› BUGFIX: Foo bar baz ipsum blah in lorem
git commit -m ":sparkles: Add new baz ipsum blah" ✨ Add new baz ipsum blah

Credit to these posts/people

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