lint-staged: Error:Current directory is not a git directory!
Description
There is an error in v8.2.0,Current directory is not a git directory!
Steps to reproduce
I have this problem when I installed the new version of lint-staged. I think it may be because my .git is in the upper level of the installation directory. install path:/web-front/src-new/node_modules/lint-staged .git path: /web-front/.git
Debug Logs
Environment
- OS: macOS High Sierra
- Node.js: v10.14.1
lint-staged
: v8.2.0
Ps
This should be because you changed the way get the .git directory in the new version. husky issue: https://github.com/typicode/husky/issues/500 your commit: https://github.com/okonet/lint-staged/commit/6ac666d
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 5
- Comments: 30 (16 by maintainers)
Commits related to this issue
- chore(project): downgrade lint-staged because of a bug info: https://github.com/okonet/lint-staged/issues/627 — committed to merkle-open/generator-nitro by ernscht 5 years ago
- Updated lint-staged to ^8.2.1 to address 'not a git directory' bug https://github.com/okonet/lint-staged/issues/627 — committed to bethurban/WRITEME by bethurban 5 years ago
- chore: update lint-staged to ~11 I keep hitting the issue[1], upgrading lint-staged seems to have helped. [1] https://github.com/okonet/lint-staged/issues/627 — committed to zregvart/syndesis by zregvart 3 years ago
figured it out…
🎉 This issue has been resolved in version 8.2.1 🎉
The release is available on:
Your semantic-release bot 📦🚀
I got the same problem with 8.2.0 on Linux Ubuntu 18.04, node 10.15.3.
After further investigations, I found out that only the following versions fail:
10.0.0 and 10.0.5 works fine
Running
yarn upgrade lint-staged
resolved the issue for me.@carnun I commented directly on the PR #628; I’d prefer that to #629 if it works, but personally am fine with either.