python - 懦弱地拒绝安装带有 `core.hooksPath` 集的钩子(Hook)

标签 python git pre-commit pre-commit.com

我试着运行这个命令,但它总是显示这个错误,无论如何我都无法修复它。请帮助我!

(venv)<...>预提交安装

[错误] Cowardly 拒绝安装设置了 core.hooksPath 的钩子(Hook)。

提示:git config --unset-all core.hooksPath

最佳答案

  1. 运行:

    git config --unset-all core.hooksPath
    
  2. 如果全局 core.hooksPath 不为空,运行:

    git config --global --unset-all core.hooksPath
    

    当然,它是全局性的,所以要小心。

    为什么预提交对全局 Hook 不起作用?见issue

关于python - 懦弱地拒绝安装带有 `core.hooksPath` 集的钩子(Hook),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67793193/

相关文章:

svn - 带有svn界面的git?

git添加错误: "fatal : malloc, out of memory"

git 预提交钩子(Hook) : trigger only to actual to be commited code?

git - Rubocop:从命令行给出的列表中排除文件

python - 使用 Python 3 阻止 Windows 10 关机

python - 使用一行代码打印一个for循环

python - 使用 python 编写 mpeg-1 视频

javascript - 错误 : AttributeError: 'coroutine' object has no attribute 'newPage' when doing youtube webscraping

git - 强制更改提交者的电子邮件

git - 在 Git 中提交之前临时清除未跟踪的文件