Monster Dump 在 分享一个 Claude Code 生成 Git 提交信息的“斜杆命令” 中发帖
适合人群
能接受 conventional commits 风格
“手动控制”添加修改文件 (git add xxx) 到 staged
能接受调用完命令生成完提交信息之后会被 AskUserQuestion 工具向你确认是否进行 git commit的繁琐
“手动控制” push commit 到远端仓库
因为这个 command 只会对手动提交到 staged 的文件进行查看,分析,生成提交信息
生成 Git 提交中文信息
创建文件$HOME/.claude/commands/gen-commit-msg-cn.md ,将下面的内容复制进去
▶
gen-commit-msg-cn.md
生成 Git 提交英文信息
创建文件$HOME/.claude/commands/gen-commit-msg.md ,将下面的内容复制进去
▶
gen-commit-msg.md