支持的提交类型
| 类型 |
说明 |
feat |
引入新功能 |
fix |
修复 Bug |
docs |
只改动了文档 |
style |
格式调整(空格、分号、缩进) |
refactor |
重构代码 |
perf |
性能优化 |
test |
添加或修改测试代码 |
build |
影响构建系统或外部依赖 |
ci |
修改 CI 配置文件或脚本 |
chore |
其他事务性更改 |
revert |
撤销之前的提交 |
design |
策划相关提交 |
art |
美术相关提交 |
使用说明
- 自动安装:打开任意 Git 工程时,插件会自动把
commit-msg 钩子写入 .git/hooks/
- 手动触发:按
Ctrl+Shift+P → 输入 Git Hook: Install Commit Msg Hook
- 卸载钩子:按
Ctrl+Shift+P → 输入 Git Hook: Uninstall Commit Msg Hook
配置项
在 settings.json 中可修改:
{
"gitCommitMsgHook.enabled": true,
"gitCommitMsgHook.showNotification": true,
"gitCommitMsgHook.types": [
"feat", "fix", "docs", "style", "refactor",
"perf", "test", "build", "ci", "chore",
"revert", "design", "art"
]
}
| 配置项 |
说明 |
enabled |
是否自动安装(默认 true) |
showNotification |
安装/卸载时是否弹通知(默认 true) |
types |
允许的提交类型列表 |
| |