Git pre-commit hook not running on windows

前端 未结 9 1073
盖世英雄少女心
盖世英雄少女心 2021-01-31 08:15

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.

9条回答
  •  别跟我提以往
    2021-01-31 08:59

    Tried solutions suggested in other answers and it didn't help to fix this problem: cannot spawn .git/hooks/pre-commit: No such file or directory.

    The solution which worked for me was to rename the file .git/pre-commit.sample to .git/pre-commit and insert the script for formatting changed files with prettier. The file with the name 'pre-commit' which I have created manually must have had some problems (encoding or end-line symbols remains unclear).

提交回复
热议问题