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.
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).