关于git中常规提交消息的问题

The*_*mer 13 git conventional-commits

我正在尝试适应本文中描述的传统提交消息

这是文章的一个片段:

允许<type>值:

feat (new feature)
fix (bug fix)
docs (changes to documentation)
style (formatting, missing semi colons, etc; no code change)
refactor (refactoring production code)
test (adding missing tests, refactoring tests; no production code change)
chore (updating grunt tasks etc; no production code change)
Run Code Online (Sandbox Code Playgroud)

但有时有些变化很难归类为此类。我将列出一些关于使用哪种类型感到困惑的更改

在这种情况下我应该使用什么类型

  1. 我在现有组件上添加了 css 样式(react、Angular、Vue 等)
  2. 我在项目中编辑了配置文件,例如package.json.prettierc等。
  3. 重命名文件
  4. 删除文件

icc*_*c97 8

这是更详细的常规提交类型

  • build:影响构建系统或外部依赖项的更改(示例范围:gulp、broccoli、npm)
  • ci:对 CI 配置文件和脚本的更改(示例:CircleCi、SauceLabs)
  • docs:仅更改文档
  • 壮举:一项新功能
  • 修复:错误修复
  • perf:提高性能的代码更改
  • 重构:既不修复错误也不添加功能的代码更改
  • test:添加缺失的测试或纠正现有的测试

对于您的每个问题,我都将我会使用的类型放在其下方。

我在现有组件上添加了 css 样式(react、Angular、Vue 等)

feat

我编辑了项目中的配置文件,例如 package.json、.prettierc 等。

build

重命名文件

refactor,可能添加BREAKING CHANGE

删除文件

refactor,可能添加BREAKING CHANGE


jam*_*mes 3

您所指的灵感来自 Angular 的提交规则:

https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits

另请参阅:

https://github.com/commitizen/conventional-commit-types/blob/master/index.json

https://github.com/pvdlg/conventional-commit-types

我认为对于你的一些观点,比如“删除文件”,这可能取决于你删除它的原因。例如,删除一个文件,因为您已将其代码移动到更合乎逻辑的位置 - 这可能是一个重构