Failed to locate pre-commit hook
See original GitHub issueDescription
The latest version popup error when I try to commit code.

This works fine before I upgraded to the latest version.
Version
- GitHub Desktop: 1.2.6
- Operating system: Win10
Steps to Reproduce
Install precommit (https://github.com/observing/pre-commit) Add
“precommit”: { “run”: “tslint” },
to package.json
And commit anything, you will see that error.
Additional Information
I found this issue in dugite https://github.com/desktop/dugite/issues/96 And the latest version of Githubdesktop use ASAR file as well, so there might have some connection. Hope this could help somehow.
Logs
2018-06-26T08:55:27.234Z - info: [ui] [AppStore] loading 2 repositories from store 2018-06-26T08:55:27.235Z - info: [ui] [AppStore] found account: JoeyLi-1 (Joey Li) 2018-06-26T08:55:27.721Z - info: [ui] launching: 1.2.6 (Windows 10.0.17134) 2018-06-26T08:55:27.721Z - info: [ui] execPath: ‘C:\Users\joey\AppData\Local\GitHubDesktop\app-1.2.6\GitHubDesktop.exe’ 2018-06-26T08:55:28.739Z - warn: [ui] fetchRepository: ‘clarifyhealth/carepilot-web’ returned a 404 2018-06-26T08:55:35.034Z - error: [ui]
git commit -F -exited with an unexpected code: 1. error: cannot spawn .git/hooks/pre-commit: No such file or directory
Please review this issue. Thank you!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:14 (4 by maintainers)

Top Related StackOverflow Question
@shiftkey Finally, I found out the reason. After I added “C:\Program Files\Git\bin” to the system environment “path”, it works. the git/bin contains the bash which is required by my pre-commit hook.
Not sure why the old githubdesktop application worked fine without this environment path…
However, it works. Thank you for your help! 😃