Skip pre-commit hook in "npm version" comand

Not sure why this functionality didn't exist in npm before, but I contributed it a little while ago, as I needed it myself. It shipped with [email protected]. To use it, set the config option commit-hooks = false in your .npmrc and the underlying git call will not run commit hooks when creating the version commit. If you only want to disable commit hooks on a single versioning, you can run something similar to:

npm version --no-commit-hooks minor

or alternatively:

npm version --commit-hooks false minor

According to npm cli docs you can skip the generation of a git tag by using

npm --no-git-tag-version version

From the docs

commit-hooks

  • Default: true
  • Type: Boolean

Run git commit hooks when using the npm version command.

If you simply want to allow this one time run the follow

npm version --no-commit-hooks patch|minor|major

To control this permanently, run the following command

npm config set commit-hooks false

Or add this line to your .npmrc file

commit-hooks=false