Years ago during an interview with a startup, I was shown some of the codebase on GitHub. I don’t remember any of the code, but one thing that did stick out to me was the fact that the commit messages had emojis. I asked the interviewer what they were for, and the answer has stuck with me ever since.
So why do people use emojis in their git commits? Essentially, it’s to add more information about a commit. Imagine your website is having production problems: your boss is yelling at you, the pressure is on, the frontend is broken, and you’re looking through the commit log to see which of the 20 commits today caused it. You’ve already gone through the JavaScript console and know that a file is missing. You see 🔥 - a file was removed but its references weren’t. Don’t forget to use 🐛 in your commit message!
The idea is to help quickly categorize commits, ideally allowing you to find the responsible commit quickly in times of emergency. I can’t speak for large distributed repositories like Atom, but for CMD Resume, I only found using emojis helpful a few times over the course of nearly 500 commits.
Emoji commit schemas:
- Gitmoji - very polished and has a nice CLI tool
- Git Commit Message StyleGuide - quite well thought out and has a CLI tool
- Atom Commit Message Styleguide - Atom text editor’s git commit styleguide
- Emoji Log - deliberately limited schema
- Commit Message Emoji
There are quite a few standards, often with clashing emoji meanings. This reminds me of the XKCD comic below.
That being said, I stick to Gitmoji and have previously used the Git Commit Message StyleGuide.
So why don’t I use it for all my projects? As I mentioned before, I’ve only found it useful in a few instances. I often found myself referring to the Gitmoji guide trying to find the most appropriate emoji for the occasion. I managed to remember a few key emojis, but I would often get stumped when making a change that didn’t fit into a neat category.
Although this might not be applicable in all situations, sometimes emojis won’t be displayed, but by using shortcodes you can see the fallback text. For example: :twisted_rightwards_arrows: Merge code
. So I’ve only been using it sparingly on a select few projects. I have been seeing productivity gains in the frontend + backend project I’m currently developing.
As I sit here writing this post, I’m not sure how to sum it all up. I’m not sure if I would recommend using emojis in git commits. I haven’t seen the productivity payoff yet, but I can see how it could be beneficial, particularly in the commercial arena. That being said, I definitely suggest giving it a try, it might be your thing!