"Not a git repository" error in Cygwin
See original GitHub issuepre-commit install
seems to have worked fine, but when executing pre-commit run
I run into the following problem:
$ pre-commit run
[INFO] Initializing environment for git://github.com/pre-commit/pre-commit-hooks.
An unexpected error has occurred: CalledProcessError: Command: ['git', 'reset', 'v0.4.2', '--hard']
Return code: 128
Expected return code: 0
Output: (none)
Errors:
fatal: Not a git repository (or any of the parent directories): .git
Check the log at ~/.pre-commit/pre-commit.log
This is a Windows machine, inside a Cygwin shell, with 1.9.4.msysgit.2 and Python 2.7.10.
Obviously this is working just fine on my colleagues’ computers who are on Macs 😢
Issue Analytics
- State:
- Created 8 years ago
- Comments:17 (10 by maintainers)
Top Results From Across the Web
Git error - Fatal: Not a git repository and how to fix it | Datree.io
This error means you attempted to run a Git command, but weren't inside a Git repository. Make sure you've: Navigated to the right...
Read more >'X' does not appear to be a git repository (I'm sure the path is ...
It is my experience that cygwin passes the wrong path style to msysgit. Msysgit doesn't understand /cygdrive and therefore messes it up, except ......
Read more >git can not access remote repository anymore after cygwin+git ...
Commands such as "git pull" or "git push" result into the error fatal: Could not read from remote repository. Please make sure you...
Read more >How to Fix the “fatal: not a git repository” Error - ContainIQ
In short, the fatal: not a git repository error indicates that your current working directory isn't tracked by Git. If you find yourself...
Read more >Cloning GitHub repository gives errors about cygwin1.dll version
This problem is probably due to using incompatible versions of the cygwin DLL. Search for cygwin1.dll using the Windows Start->Find/Search ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sounds great! Glad to help 😃
I’ve opened #354 to at least make this error case more obvious – I’ll see if I can’t make it easy to “just work” in these cases, barring that I’ll at least add an error message in the short term.
Thanks again for the great bug report and useful debugging information!
I installed that and will try using that for now, and cross other bridges if I were to run into further Git problems. It’s a while ago I had these problems, they’ve had some time to improve 😉 Thanks for you quick support throughout this process. My company is starting to use
pre-commit
as the outcome of a hackathon, and we’re excited about it, but it’s good to know there’s some “community support” when needed 😄