Skip to content

Instantly share code, notes, and snippets.

@madkoding
Last active July 21, 2021 21:50
Show Gist options
  • Save madkoding/73ad4a6ed9855f1894c8806a29af1e58 to your computer and use it in GitHub Desktop.
Save madkoding/73ad4a6ed9855f1894c8806a29af1e58 to your computer and use it in GitHub Desktop.
Semantic Emoji Commit Messages for Git

Semantic Emoji Commit Messages

Helps to keep a better order and keep easy to understand every change in the git log history Emojis looks nice, and i chose the most easy to remember ones

Syntax

type [scope] subject
emoji section (optional) Summary (present tense)

Commit example: :star:[Navbar] Add new links

How will look your git log history:

  • ⭐ [Navbar] Add new links
  • 🪲 [Sidebar] Fix issue in react hook
  • ♻️ Refactor gitlabci.yml

Usage

emoji type meaning
:star: ⭐ feature Add new code/tests
:beetle: 🪲 bug/fix Bug fixes for code/tests
:recycle: ♻️ refactor Update/refactor code/tests
:gear: ⚙️ chore Update build/CI/Docker tasks
:art: 🎨 style Design update (css/fonts/html)
:book: 📖 docs Changes in documentation or readme

How to use them

I recommend to use commitizen and cz-emoji to make it work out of the box.

npm install commitizen -g
npm install cz-emoji -g

After install commitizen and cz-emoji packages, you need to create a .czrc config file in your root project folder

{
  "path": "cz-emoji",
  "config": {
    "cz-emoji": {
      "symbol": true,
      "skipQuestions": ["issues","breaking"],
      "types": [
        {
          "emoji": "",
          "code": ":star:",
          "description": "Add new code/tests.",
          "name": "feature"
        },
        {
          "emoji": "🐞",
          "code": ":beetle:",
          "description": "Bug fixes for code/tests.",
          "name": "bugfix"
        },
        {
          "emoji": "♻️",
          "code": ":recycle:",
          "description": " Update/refactor code/tests.",
          "name": "refactor"
        },
        {
          "emoji": "⚙️",
          "code": ":gear:",
          "description": " Update build/CI/Docker tasks.",
          "name": "chore"
        },
        {
          "emoji": "🎨",
          "code": ":art:",
          "description": "Design update (css/fonts/html).",
          "name": "style"
        },
        {
          "emoji": "📖",
          "code": ":book:",
          "description": "Changes in documentation or readme.",
          "name": "docs"
        }
      ]
    }
  }
}

References:

https://www.conventionalcommits.org/

https://seesparkbox.com/foundry/semantic_commit_messages

http://karma-runner.github.io/1.0/dev/git-commit-msg.html

https://gist.github.com/parmentf/035de27d6ed1dce0b36a

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