Closed rafae2k closed 2 years ago
I'm having the same experience as @rafae2k. Seems to be a known issue already though. See #839 from '21.
If you add this hook, you should use git commit
to start it
BTW: This is not recommended to add this hook
@Zhengqbbb i have all hooks, following git workflow.
pre-commit
- runs lintstaged
prepare-commit-msg
- runs cz
commit-msg
- runs commitlint
even though with or without commit-msg when prepare-commit-msg
it opens editor (vim, code, etc...)
prepare-commit-msg - runs cz
Let's see why
The first is the name of the hook, think about what it means: prepare-commit-msg
.
And then is the hook behavior, why does the editor open. You can try running the command git commit
in other projects without hooks.
Anyway, this hook is triggered once the commit message is added, and the hook running the command will eventually become git commit
, and it will automatically open the editor to edit your .git/COMMIT_EDITMSG
file.
https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks search text: prepare-commit-msg
BTW As a CLI shouldn't use that hook for launching, I think it's wrong https://cz-git.qbenben.com/cli/install.html#as-git-hooks-use
ref: https://github.com/commitizen/cz-cli/issues/934#issuecomment-1982811302
git config --local core.editor cat
Is this resolved?
Is this resolved?
have a try:
npx czg
# or
bunx czg
I'm using husky, commitzen and commitlint to setup my commit messages.
i added a prepare-commit-msg hook on husky to create my commit using commitzen cli. It all works perfectly, but when i finish my message on cli it opens the editor, and only when i close the editor it successfully create my commit.