当我运行 npm version patch
时,将进行新的提交。我不想要它。
doc很模糊。我猜测相关的标志是commit-hooks
,但我不确定如何使用它。没有例子。
我尝试过不同的模式,例如:
npm version patch --commit-hooks=false
npm version patch --commit-hooks false
但是好像不行。
最佳答案
--commit-hooks
参数确定是否 Git Hooks在提交创建时运行。
你想要的命令是npm version patch <a href="https://docs.npmjs.com/cli/v8/commands/npm-version#git-tag-version" rel="noreferrer noopener nofollow">--git-tag-version</a> false
Tag the commit when using the
npm version
command. Setting this to false results in no commit being made at all.
关于npm - 运行 `npm version` 脚本时,如何防止进行新提交,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72194541/