Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Skip pre-commit hook in "npm version" command

npm version commits the change to package.json and creates a tag. Is there a way to prevent commit hook from being executed while using this command?

like image 825
esp Avatar asked May 19 '17 19:05

esp


1 Answers

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
like image 166
faazshift Avatar answered Sep 19 '22 10:09

faazshift