Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

完全无效 #101

Open
inksnowhailong opened this issue Jan 19, 2024 · 7 comments
Open

完全无效 #101

inksnowhailong opened this issue Jan 19, 2024 · 7 comments
Labels
question Further information is requested

Comments

@inksnowhailong
Copy link

安装了,初始化了,一切配置按照官网来了。但是我之间commit 就像没有它一样,之间就commit,没有执行我需要的命令

@awxiaoxian2020
Copy link

awxiaoxian2020 commented Jan 31, 2024

You should run npx simple-git-hooks. If this doesn't work please provide a repro example.

@toplenboren
Copy link
Owner

Hi! @inksnowhailong, thanks for reaching out. Please use English language in issues or pull requests, if I can be of help please rewrite your issue in english 🤝

@toplenboren toplenboren added the question Further information is requested label Feb 25, 2024
@like0413
Copy link

me too

@ASCII26
Copy link

ASCII26 commented Aug 21, 2024

Hi! @inksnowhailong, thanks for reaching out. Please use English language in issues or pull requests, if I can be of help please rewrite your issue in english 🤝

@toplenboren I use this library in the mono repo and configure it in the sub-repository's package.json according to the official documentation, but it doesn't work before I commit. Why?

@toplenboren
Copy link
Owner

Hi, @ASCII26 do you have a reproduction example?

@Jun2030
Copy link

Jun2030 commented Oct 17, 2024

I have already solved this problem, which may serve as a reference.

git config core.hooksPath .git/hooks/
rm -rf .git/hooks

# Update ./git/hooks
npx simple-git-hooks

@mmdapl
Copy link

mmdapl commented Oct 28, 2024

大概率你是从husky迁移到simple-git-hooks出现不可用的,我也出现这个问题。你可以按照README.md上提示,进行自检。参考:

huskygit 迁移时钩子未运行
为什么会发生这种情况?

Husky 可能会将core.gitHooks值更改为.husky,这样 git hooks 就会搜索.husky目录而不是.git/hooks/。

在Git 书中了解有关 git 配置的更多信息

你可以通过在你的 repo 中运行以下命令来检查它:

git config core.hooksPath

如果输出.husky,那么这就是你的情况

如何修复?

您需要将core.gitHooks值指向your-awesome-project/.git/hooks。您可以使用以下命令:

git config core.hooksPath .git/hooks/

验证值是否设置:

git config core.hooksPath

应该输出:.git/hooks/

然后删除.husky先前生成的文件夹husky。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

7 participants