How to manually run a git pre-commit hook, without attempting a commit?

一个人想着一个人 提交于 2019-12-04 22:14:32

Just run the pre-commit script through shell:

bash .git/hooks/pre-commit
javabrett

There's a Python package for this available here. Per the usage documentation:

If you want to manually run all pre-commit hooks on a repository, run pre-commit run --all-files. To run individual hooks use pre-commit run <hook_id>.

So pre-commit run --all-files is what the OP is after.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!