githooks

How can I manually run a Git pre-commit hook, without attempting a commit?


I just want to be able to run it to see if the code in my working tree passes it, without actually attempting a commit.


Solution

  • Just run the pre-commit script through the shell:

    bash .git/hooks/pre-commit