Git pre-commit hook not running on windows
问题 I'm just starting to look into Git hooks, but I can't seem to get them to run. I set up a local repository, so there is now a '.git' directory in my project folder. I have added a '.cmd' file into the C:/path/to/my/project/.git/hooks directory named 'pre-commit.cmd'. Here is the contents of this file: echo "HOOK RUNNING" echo. 2>C:/path/to/my/project/.git/hooks/EmptyFile.txt This should echo the text "HOOK RUNNING" and create an empty text file in that directory. However, if I commit changes