commitizen / commitizen/cz-cli

git commit -m to pre-fill commit title

未关闭
#847 9 条评论 9 个 reaction 已指派 1 人 已被 @dmwelch 认领 在 GitHub 查看
主要语言
JavaScript
星标
17.5k
派生
566
平均合并
8 小时 16 分钟
30 天内合并 PR
1

描述

With [husky][1] setup, the `-m` is lost.

I'm a CLI guru, so if I typed `-m` already, it should be used as a base, for example, add the category to it unless missing.

```
$ git commit -m 'Add prepare commit msg hook'
$ git commit -m 'feat: Add prepare commit msg hook'
```

currently have to re-type everything with several prompts. kind of slows down the commit process, driving away from the git hook setup.

Husky part:
```diff
--- a/package.json
+++ b/package.json
@@ -105,6 +105,7 @@
},
"husky": {
"hooks": {
+ "prepare-commit-msg": "exec < /dev/tty && git cz --hook || true",
"pre-commit": "lint-staged"
}
},
```

[1]: https://github.com/commitizen/cz-cli#husky

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。