I get this error when I try to commit.
OS - Latest OSX
Git version - git version 2.11.0 (Apple Git-81)
.git/hooks/pre-commit: line 2: ./node_modules/pre-commit/hook: No such file or directory
Open a terminal window by using option + T in GitKraken Client. Once the terminal windows is open, change directory to . git/hooks . Then use the command chmod +x pre-commit to make the pre-commit file executable.
Use the --no-verify option to skip git commit hooks, e.g. git commit -m "commit message" --no-verify . When the --no-verify option is used, the pre-commit and commit-msg hooks are bypassed.
The pre-commit hook is run first, before you even type in a commit message. It's used to inspect the snapshot that's about to be committed, to see if you've forgotten something, to make sure tests run, or to examine whatever you need to inspect in the code.
pre-commit by default places its repository store in ~/. cache/pre-commit -- this can be configured in two ways: PRE_COMMIT_HOME : if set, pre-commit will use that location instead.
pre-commit hook runs first when you try to commit changes, it can be used to do certain checks, tests, conditions. In this case, clearly, you don't have it, that's why it's complaining.
Go to .git/hooks
directory and remove pre-commit
file, as its trying to reference to node_modules/pre-commit/hook
. It should resolve it.
Other option is append your commit with option: --no-verify
, it will make the commit without checking.
You should delete node_modules
folder and install again running npm install
or yarn install
. After it, you probably solve the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With