Using Emojis in Commit Messages

March 25, 2024

Typically, when creating commit messages using Git, you will need to provide a commit message, which details in a very short summary what changes you have made within the commit.

Some people aren't bothered to write a proper commit messages, to which they end up using GitHub's automatic commit messages, which go something along the lines of...

Update README.md

If they do end up writing a commit message, it ends up being just what the change was in that commit.

Fix errors in browser console

While these are still completely valid ways of writing commit messages and are not a problem, most people use Conventional Commits for commit messages, which follow this structure.

docs: add requirement for Node.js 18 or higher

This gives some important details about what you are changing, and the description of what that commit is.

You can also use optional scopes to denote a change in a specific part of your project.

chore(docs): remove outdated information

(docs) is the optional scope here, as you are changing something specifically within the documentation of your project and no other parts.

You can also refer to a larger part of your project. For example, you could use (frontend) to signify that you are making changes to the frontend of your project.

However, I like to expand my own commit messages on top of the conventional commits by using Gitmoji, a set of emojis that link to different types of conventional commits, as well as my own set of emojis that I use for other, more specific purposes. Some of them are taken/have inspiration from this GitHub Gist. Below, you can see a few example use cases of these emojis within the commit message.

โœจ feat: add `--fix` option
โ™ป๏ธ refactor(setup): rework setup process
๐Ÿ“ฆ chore: bump dependencies

For me, this helps to make the commits stand out, and know what kind of commit it was, whether it was something small, like a typo, or a complete refactor of something. They also make the project look less 'bland' and easier to see the type of changes made.

If you want more example use cases of these, you can check out one of my projects, mdbadges-cli, where I use this style of commit message for all of my commit messages.

Here is a list of the emojis and the type of conventional commits I most commonly use when committing changes:

EmojiMeaningType
๐ŸŽ‰Initial commitfeat:
โœจAdding a new featurefeat:
๐Ÿ›Fixing a bug/issuefix:
โ™ป๏ธRefactoring code/logicrefactor:
๐Ÿ’„Adjusting/adding stylingstyle:
โœ๏ธAdjusting textchore:
๐Ÿ’ฅBreaking ChangesBREAKING:
๐Ÿ“Documentationdocs:
๐ŸงนGeneral updates and adjustmentschore:
๐Ÿ‘ทConfiguration (e.g., Dependabot)config:
๐Ÿ“ฆPackageschore(package):
๐Ÿค–Automationchore:
๐Ÿ”–Bumping versionschore(release):
๐ŸงชTeststests:
๐Ÿ”ฅRemoving old/unused thingschore:
๐ŸššMoving/rearranging fileschore:

Some ways to expand this is by adding this style of commit to your dependabot.yml configuration file. For example, I have the following configuration set up in mdbadges-cli to update dependencies for npm and GitHub Actions with these custom prefixes:

version: 2
updates:
  - package-ecosystem: "npm"
    directory: "/"
    schedule:
      interval: "daily"
      time: "09:30"
    commit-message:
      prefix: "๐Ÿ“ฆ chore(package):" # commit prefix for package updates
  - package-ecosystem: "github-actions"
    directory: "/"
    schedule:
     interval: "daily"
     time: "09:30"
    commit-message:
      prefix: "๐Ÿค– chore(action):" # commit prefix for github actions
  • ๐Ÿ“ฆ signifies a dependency update to the package.
  • ๐Ÿค– signifies an automated GitHub Action, which is normally performed without human interaction, thus having the connotation of a robot and automation.

With that configuration, any pull requests opened from Dependabot will look something like this:

A pull request that bumps a package.

A pull request that bumps a package.


A pull request that bumps an action.

A pull request that bumps an action.


Overall, I think that emojis are a great way to display relevant changes to your growing project and it would help you and other people to further understand what changes were made in that commit and for what reason/what they link to.

As said before, you can further expand this in other ways. For example, you can use CLI tools such as better-commits to generate commit messages using emojis, types, scopes, and more, right from the terminal, and this is just just one of many ways to expand the use of commit emojis.


#personal#git#emoji
Last updated on16/08/24 13:35