问题描述
操作系统 - 最新的OSX
Git版本 - git版本2.11.0(Apple Git-81)
.git / hooks / pre-commit:第2行:./node_modules / pre-commit / hook:没有这样的文件或目录
当您尝试提交更改时,pre-commit钩子首先运行,它可用于执行某些检查,测试和条件。在这种情况下,显然,你没有它,这就是为什么它抱怨。
转到 .git / hooks
目录并删除 pre-commit
文件,因为它试图引用 node_modules / pre-commit / hook
。它应该解决它。
其他选项是附加提交选项: - no-verify
,它会在不检查的情况下进行提交。
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
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.
这篇关于预先提交/挂钩:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!