Gitのコミットメッセージで絵文字を使う

会社の人がやっていたので真似てみる。

gitmoji.carloscuesta.me

gitmojiを使うらしいので早速セットアップする。

インストール

npmがインストールされているなら以下だけです。

npm i -g gitmoji-cli

絵文字を使ってコミットする

gitmoji -cを利用してインタラクティブにコミットができます。

$ gitmoji -c
? Choose a gitmoji: 🎉  - Initial commit.
? Enter the commit title [12/48]: First commit
? Enter the commit message:
[master (root-commit) 01736ce] :tada: First commit
 1 file changed, 1 insertion(+)
 create mode 100644 README.md

gitmoji -iを実行しておくとgit commitを実行時にフックしてくれます。

$ gitmoji -i
✔ Gitmoji commit hook created successfully

$ git commit
? Choose a gitmoji: 📝  - Writing docs.
? Enter the commit title [25/48]: Update readme description
? Enter the commit message:
[master d34dee1] :pencil: Update readme description
 1 file changed, 2 insertions(+)

Github上で絵文字が表示されているのが確認できます。 f:id:tnnsst35:20200604232512p:plain

絵文字一覧を見る

絵文字のルールは事前に決めておいたほうが良さそうです。

$ gitmoji -l
✔ Gitmojis fetched successfully
🎨 - :art: - Improving structure / format of the code.
⚡️ - :zap: - Improving performance.
🔥 - :fire: - Removing code or files.
🐛 - :bug: - Fixing a bug.
🚑 - :ambulance: - Critical hotfix.
✨ - :sparkles: - Introducing new features.
📝 - :pencil: - Writing docs.
🚀 - :rocket: - Deploying stuff.
💄 - :lipstick: - Updating the UI and style files.
🎉 - :tada: - Initial commit.
✅ - :white_check_mark: - Updating tests.
🔒 - :lock: - Fixing security issues.
🍎 - :apple: - Fixing something on macOS.
🐧 - :penguin: - Fixing something on Linux.
🏁 - :checkered_flag: - Fixing something on Windows.
🤖 - :robot: - Fixing something on Android.
🍏 - :green_apple: - Fixing something on iOS.
🔖 - :bookmark: - Releasing / Version tags.
🚨 - :rotating_light: - Removing linter warnings.
🚧 - :construction: - Work in progress.
💚 - :green_heart: - Fixing CI Build.
⬇️ - :arrow_down: - Downgrading dependencies.
⬆️ - :arrow_up: - Upgrading dependencies.
📌 - :pushpin: - Pinning dependencies to specific versions.
👷 - :construction_worker: - Adding or updating CI build system.
📈 - :chart_with_upwards_trend: - Adding or updating analytics or tracking code.
♻️ - :recycle: - Refactoring code.
🐳 - :whale: - Work about Docker.
➕ - :heavy_plus_sign: - Adding a dependency.
➖ - :heavy_minus_sign: - Removing a dependency.
🔧 - :wrench: - Changing configuration files.
🌐 - :globe_with_meridians: - Internationalization and localization.
✏️ - :pencil2: - Fixing typos.
💩 - :poop: - Writing bad code that needs to be improved.
⏪ - :rewind: - Reverting changes.
🔀 - :twisted_rightwards_arrows: - Merging branches.
📦 - :package: - Updating compiled files or packages.
👽 - :alien: - Updating code due to external API changes.
🚚 - :truck: - Moving or renaming files.
📄 - :page_facing_up: - Adding or updating license.
💥 - :boom: - Introducing breaking changes.
🍱 - :bento: - Adding or updating assets.
👌 - :ok_hand: - Updating code due to code review changes.
♿️ - :wheelchair: - Improving accessibility.
💡 - :bulb: - Documenting source code.
🍻 - :beers: - Writing code drunkenly.
💬 - :speech_balloon: - Updating text and literals.
🗃 - :card_file_box: - Performing database related changes.
🔊 - :loud_sound: - Adding or updating logs.
🔇 - :mute: - Removing logs.
👥 - :busts_in_silhouette: - Adding or updating contributor(s).
🚸 - :children_crossing: - Improving user experience / usability.
🏗 - :building_construction: - Making architectural changes.
📱 - :iphone: - Working on responsive design.
🤡 - :clown_face: - Mocking things.
🥚 - :egg: - Adding or updating an easter egg.
🙈 - :see_no_evil: - Adding or updating a .gitignore file
📸 - :camera_flash: - Adding or updating snapshots
⚗ - :alembic: - Experimenting new things
🔍 - :mag: - Improving SEO
☸️ - :wheel_of_dharma: - Work about Kubernetes
🏷️ - :label: - Adding or updating types (Flow, TypeScript)
🌱 - :seedling: - Adding or updating seed files
🚩 - :triangular_flag_on_post: - Adding, updating, or removing feature flags
🥅 - :goal_net: - Catching errors
💫 - :dizzy: - Adding or updating animations and transitions
🗑 - :wastebasket: - Deprecating code that needs to be cleaned up.