如何在 git commit message 中玩溜 emoji

2,454 阅读3分钟
原文链接: github.com

Ref: gitmoji.carloscuesta.me/

如上这个 emoji commit message 指引感觉非常好,所以大致翻译了下和大家分享

出发点源于最近在梳理和制定一套标准化且规范化开发细则,其中如何管理 commit 就是其中很重要的一个环节

借鉴了 angular 开发的规范,目前也是比较大规模使用的。

在指引文档中其中有一点涉及

Subject The subject contains succinct description of the change:

  • use the imperative, present tense: "change" not "changed" nor "changes"
  • don't capitalize first letter
  • no dot (.) at the end

其中就有 use the imperative, present tense,回过头想其实平时开发中很少有同学能把一些关键信息用简易且关键的英文动词来描述清楚此次 commit 的动机,而这篇指引一方面用了 emoji 这种形象化的方式外,关键多了解释说明,让我们这种英文不好的同学也能快速掌握到要领,同时可以把这些点,适用到 Subject 中。

🎨 :art: Improving structure / format of the code. 改进目录或代码结构 / 格式化代码

⚡️ :zap: Improving performance. 提升性能

🔥 :fire: Removing code or files. 移除代码或文件

🐛 :bug: Fixing a bug. 修复 bug

🚑 :ambulance: Critical hotfix. 紧急修复

:sparkles: Introducing new features. 新 feature

📝 :memo: Writing docs. 书写文档

🚀 :rocket: Deploying stuff. 部署相关

💄 :lipstick: Updating the UI and style files. 更新 UI 和 样式文件

🎉 :tada: Initial commit. 首次提交

:white_check_mark: Adding tests. 新增测试用例

🔒 :lock: Fixing security issues. 修复安全性问题

🍎 :apple: Fixing something on macOS. 修复 macOS 平台上的缺陷

🐧 :penguin: Fixing something on Linux. 修复 Linux 平台上的缺陷

🏁 :checkered_flag: Fixing something on Windows. 修复 Windows 平台上的缺陷

🤖 :robot: Fixing something on Android. 修复 Android 上的缺陷

🍏 :green_apple: Fixing something on iOS. 修复 iOS 上的缺陷

🔖 :bookmark: Releasing / Version tags. 发布 / 给代码打版本化的 tag

🚨 :rotating_light: Removing linter warnings. 移除 linter 的警告

🚧 :construction: Work in progress. 开发进行时

💚 :green_heart: Fixing CI Build. 修复 CI 问题

⬇️ :arrow_down: Downgrading dependencies. 降级依赖版本

⬆️ :arrow_up: Upgrading dependencies. 升级依赖版本

📌 :pushpin: Pinning dependencies to specific versions. 锁死依赖版本

👷 :construction_worker: Adding CI build system. 添加 CI

📈 :chart_with_upwards_trend: Adding analytics or tracking code. 添加分析或埋点代码

♻️ :recycle: Refactoring code. 代码重构

:heavy_minus_sign: Removing a dependency. 移除依赖

🐳 :whale: Work about Docker. Docker 相关事由

:heavy_plus_sign: Adding a dependency. 添加一个依赖

🔧 :wrench: Changing configuration files. 修改一个配置文件

🌐 :globe_with_meridians: Internationalization and localization. 国际化和本地化

✏️ :pencil2: Fixing typos. 修正拼写错误

💩 :hankey: 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. 外部依赖 API 变更导致的代码变更

🚚 :truck: Moving or renaming files. 移动或重命名文件

📄 :page_facing_up: Adding or updating license. 添加或者更新许可

💥 :boom: Introducing breaking changes. 不兼容变更

🍱 :bento: Adding or updating assets. 新增或更新 assets 资源

👌 :ok_hand: Updating code due to code review changes. 更新由 CR 引起的代码变更

♿️ :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 logs. 增加日志

🔇 :mute: Removing logs. 移除日志

👥 :busts_in_silhouette: Adding contributor(s). 新增贡献者

🚸 :children_crossing: Improving user experience / usability. 提升用户体验 / 可用性

🏗 :building_construction: Making architectural changes. 架构变更

📱 :iphone: Working on responsive design. 真在进展响应式设计的相关事由

🤡 :clown_face: Mocking things. Mock 相关

🥚 :egg: Adding an easter egg. 彩蛋

🙈 :see_no_evil: Adding or updating a .gitignore file 新增或者更新 .gitignore 文件