在 Git 提交信息中使用 Emoji

Gitmoji 旨在解释如何在 Git 提交消息时使用表情符号。在提交信息使用表情符号,可以更容易地识别提交的目的或意图

Emoji 列表

🎨 :优化项目结构 / 代码格式

1
:art:

⚡️ :性能提升

1
:zap:

🔥 :移除代码或文件

1
:fire:

🐛 : 修改 bug

1
:bug:

🚑️:紧急修复 / Critical hotfix

1
:ambulance:

✨ : 引入新功能

1
:sparkles:

📝 :更新文档

1
:memo:

🚀 : 部署工作

1
:rocket:

💄 : UI / 样式更新

1
:lipstick:

🎉 : 初始化项目

1
:tada:

✅ : 添加或更新测试用例

1
:white_check_mark:

🔒️ : 修复安全问题

1
:lock:

🔖 : 发布版本 / 创建 tag

1
:bookmark:

🚨 :修复编译器 / linter 报错

1
:rotating_light:

🚧 : 建设中 / WIP / Work in progress.

1
:construction:

💚 : 修复 CI 构建问题

1
:green_heart:

⬇️ : 依赖版本降级

1
:arrow_down:

⬆️ : 依赖版本升级

1
:arrow_up:

📌 :锁定依赖版本

1
:pushpin:

👷 :添加或更新自动构建 / 持续集成

1
:construction_worker:

📈 : 添加或更新分析追踪代码

1
:chart_with_upwards_trend:

♻️ :代码重构

1
:recycle:

➕ :添加依赖

1
:heavy_plus_sign:

➖ : 移除依赖

1
:heavy_minus_sign:

🔧 :更新配置文件

1
:wrench:

🔨 : 更新开发脚本

1
:hammer:

🌐 :国际化与本地化

1
:globe_with_meridians:

✏️ :修复错字 / Fix typos.

1
:pencil2:

💩 : 后续要优化的代码

1
:poop:

⏪️ : 回滚更新 / Revert changes.

1
:rewind:

🔀 :合并分支

1
:twisted_rightwards_arrows:

📦️ :更新打包文件

1
:package:

👽️ : 外部 API 导致的代码更新

1
:alien:

🚚 :移动或重命名资源 (e.g.: files, paths, routes).

1
:truck:

📄 : 更新许可证

1
:page_facing_up:

💥 :引入破坏性更新 / breaking changes.

1
:boom:

🍱 : 更新资源 / assets.

1
:bento:

♿️ :提升无障碍体验

1
:wheelchair:

💡 :更新代码注释

1
:bulb:

🍻 :Write code drunkenly.

1
:beers:

💬 : 修改文本 / text and literals.

1
:speech_balloon:

🗃️ : 数据库相关操作

1
:card_file_box:

🔊 : 添加更新日志

1
:loud_sound:

🔇 :移除运行日志

1
:mute:

👥 :更新贡献者

1
:busts_in_silhouette:

🚸 提升用户体验与可用性 / UE & usability

1
:children_crossing:

🏗️ : 更改架构 / Make architectural changes.

1
:building_construction:

📱 : 响应式设计工作

1
:iphone:

🤡 :Mock 数据

1
:clown_face:

🥚 :添加彩蛋

1
:egg:

🙈 :更新 .gitignore 文件

1
:see_no_evil:

📸 :更新快照 / snapshots

1
:camera_flash:

⚗️ : 实验性功能

1
:alembic:

🔍️ : SEO 优化

1
:mag:

🏷️ : Add or update types.

1
:label:

🌱 : Add or update seed files.

1
:seedling:

🚩 : 更新功能标记 / feature flags.

1
:triangular_flag_on_post:

🥅 :异常捕获

1
:goal_net:

💫 : 更新动画过渡效果

1
:dizzy:

🗑️ :待清理的弃用代码

1
:wastebasket:

🛂 :Work on code related to authorization, roles and permissions.

1
:passport_control:

🩹 : 简单问题修复

1
:adhesive_bandage:

🧐 :数据检查 / Data exploration/inspection.

1
:monocle_face:

⚰️ :移除无用代码

1
:coffin:

gitmoji-cli

也可以通过安装 gitmoji-cli 在命令行中使用 gitmoji。

1
npm i -g gitmoji-cli

命令行使用

1
$ gitmoji --help
1
2
3
4
5
6
7
8
9
10
11
12
13
A gitmoji interactive client for using gitmojis on commit messages.

Usage
$ gitmoji
Options
--init, -i Initialize gitmoji as a commit hook
--remove, -r Remove a previously initialized commit hook
--config, -g Setup gitmoji-cli preferences.
--commit, -c Interactively commit using the prompts
--list, -l List all the available gitmojis
--search, -s Search gitmojis
--version, -v Print gitmoji-cli installed version
--update, -u Sync emoji list with the repo

Commit

可以直接使用或通过 commit hook 使用。

Client

启动命令行,会根据提示自动生成提交。

1
$ gitmoji -c

Hook

初始化钩子之后,添加更改并提交,之后将开始提示并生成提交消息。

1
2
3
$ gitmoji -i
$ git add .
$ git commit

⚠️ 钩子不要gitmoji -c 命令一起使用。

gitmoji commit

根据关键字搜索适合的 gitmoji。

1
$ gitmoji -s "criteria"

gitmoji search

List

打印所有可用的 gitmojis。

1
$ gitmoji -l

gitmoji list

Update

更新 gitmojis 列表,默认情况下,第一次运行 gitmoji 时,cli 会创建一个缓存,以在无网络的情况下使用。

1
$ gitmoji -u

Config

运行 gitmoji -g 设置首选项。

gitmoji config

Options

  • Automatic git add: 每次执行 commit 时是否自动执行 git add .
  • Emoji format: 切换表情符号格式
  • Scope prompt: 启用或禁用 conventional commits scope prompt.
  • Signed commits: 是否使用 GPG 签名提交

Reference

gitmoji

gitmoji-cli


在 Git 提交信息中使用 Emoji
https://cocomi.cf/z/posts/f237058d/
作者
Sakura Yumine
发布于
2019年5月1日
许可协议