07月29, 2023

git commit 规范使用

结合具体的代码仓库vuejs,学习AngularJS的commit规范。

Commit type 规范

  • feat: 新增 feature
  • fix: 修复 bug
  • docs: 仅仅修改了文档,比如 README, CHANGELOG, CONTRIBUTE等等
  • style: 仅仅修改了空格、格式缩进、逗号等等,不改变代码逻辑
  • refactor: 代码重构,没有加新功能或者修复 bug
  • perf: 优化相关,比如提升性能、体验
  • test: 测试用例,包括单元测试、集成测试等
  • chore: 改变构建流程、或者增加依赖库、工具等

场景1:merge

使用git commit -v,添加一下模板。

Merge branch 'feature-branch' into 'master'

This commit includes the changes from the 'feature-branch' branch into the 'master' branch.

[merge] Merge branch 'feature-branch' into 'master'

场景2:merge并且有冲突

Merge branch 'feature-branch' into 'master'

This commit includes the changes from the 'feature-branch' branch into the 'master' branch, resolving a conflict in file 'path/to/file'.

[merge] Merge branch 'feature-branch' into 'master'

场景3:修改文档markdown、changeLog、package.json和删除注释等不修改代码

chore(sfc): remove useless vue-template-es2015-compiler (#12677)

场景4:解决bug

  1. 测试提出bug。
fix(ssr): fix on-component directives rendering (#12661) 
  1. 自己修改bug。
fix: fix effect scope tracking for manually created instances

场景5:回退一个版本

git revert HEAD

    Revert "feat: ssss"
    
    This reverts commit f0047563504776110815eeea31b713f9d48f3ca1.

场景6:对代码进行重构或者优化(基础重构的优化)

refactor(shared): update genStaticKeys (#13010)

场景7:新增代码进行性能优化

perf: improve unsub perf for deps with massive amount of subs

本文链接:https://imyoyo.xyz/post/git-commit-regular-use.html

-- EOF --

Comments