lint-staged: Git add fails after eslint --fix

Here the output:

[16:45:44] eslint --fix [started]
[16:45:47] eslint --fix [completed]
[16:45:47] git add [started]
[16:45:47] git add [failed]
[16:45:47] → 🚫 git add --ignore-errors found some errors. Please fix them and try committing again.

fatal: Unable to create '…/.git/index.lock': File exists.

Another git process seems to be running in this repository, e.g.
� git add found some errors. Please fix them and try committing again.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.

[16:45:47] Running tasks for *.js [failed]

fatal: Unable to create '…/.git/index.lock': File exists.
[16:45:47] → 🚫 git add found some errors. Please fix them and try committing again.

Another git process seems to be running in this repository, e.g.

an editor opened by 'git commit'. Please make sure all processes
fatal: Unable to create '…/.git/index.lock': File exists.
are terminated then try again. If it still fails, a git process

may have crashed in this repository earlier:
Another git process seems to be running in this repository, e.g.
remove the file manually to continue.
an editor opened by 'git commit'. Please make sure all processes

are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 29 (2 by maintainers)

Commits related to this issue

Most upvoted comments

I get the same error after merging. Is there any way to fix it? And it arises on my windows. But everything is fine on the mac

Ok. I think I fixed it via

lint-staged -r

I am testing this fix.