Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: cannot spawn .git/hooks/pre-commit: No such file or directory #18251

Closed
Typhon0130 opened this issue Mar 5, 2024 · 2 comments
Closed
Labels
more-info-needed The submitter needs to provide more information about the issue

Comments

@Typhon0130
Copy link

The problem

I am using GitHub Desktop while working on Git
when click on commit button, getting below error
'error: cannot spawn .git/hooks/pre-commit: No such file or directory"
But if I use VS code instead of GitHub Desktop, it's going well for commit.

Release version

3.35(*64)

Operating system

Windows 10 Pro

Steps to reproduce the behavior

Change some files -> Commit to branch name -> error: cannot spawn .git/hooks/pre-commit: No such file or directory

Log files

No response

Screenshots

image

Additional context

I have already fixed this issue via this link
But when I commit to remote, I have to always move the pre-commit file from .git/hooks folder to another folder.
After commit, I have to repeat action again.
Is there any other good way without move the pre-commit file?
Thanks

@steveward
Copy link
Member

@Typhon0130 thanks for the issue. There are some known issues with GitHub Desktop and pre-commit hooks, often caused by environment setup. Are you using Husky? There are some workarounds that have been shared in #12562 to get Husky working, like #12562 (comment).

@steveward steveward added the more-info-needed The submitter needs to provide more information about the issue label Mar 5, 2024
Copy link

Thank you for your issue!
We haven’t gotten a response to our questions above. With only the information that is currently in the issue, we don’t have enough information to take action. We’re going to close this but don’t hesitate to reach out if you have or find the answers we need. If you answer our questions above, this issue will automatically reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-info-needed The submitter needs to provide more information about the issue
Projects
None yet
Development

No branches or pull requests

2 participants