question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to locate pre-commit hook

See original GitHub issue

Description

The latest version popup error when I try to commit code. image

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:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

10reactions
JoeyLi-1commented, Jun 28, 2018

@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! 😃

0reactions
victorchilaricommented, Aug 10, 2020

image After I added \Git\bin in path

Read more comments on GitHub >

github_iconTop Results From Across the Web

git - pre-commit/hook: No such file or directory - Stack Overflow
Go to .git/hooks directory and remove pre-commit file, as its trying to reference to node_modules/pre-commit/hook .
Read more >
pre-commit
Git hook scripts are useful for identifying simple issues before submission to code review. We run our hooks on every commit to automatically...
Read more >
Pre-commit hooks claim files are modified but no changes are ...
When the pre-commit hooks detect issues, they fail the git commit command and attempt to address them. In my case, the changes were...
Read more >
Fix Your Mistakes, Don't Commit Them! Pre-Commit Git Hook ...
It's time to stop committing broken tests, ugly code, type errors and lint errors to your git repository. With Husky, we can hook...
Read more >
Commit hooks are skipped due to PATH issues - Jira - Atlassian
This is still an issue, and a big one. We get many commits that fail in CI that should have failed in pre-commit...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found