Skip to content
| Marketplace
Sign in
Visual Studio Code>SCM Providers>Git Commit Message HookNew to Visual Studio Code? Get it now.
Git Commit Message Hook

Git Commit Message Hook

yyd

| (0) | Free
Auto-install commit-msg hook for Git commit message format validation
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

支持的提交类型

类型 说明
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 允许的提交类型列表
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft