git 出错,index.lock无法删除

问题现象:执行任何 git命令, 报错

fatal: Unable to create 'E:/web/githubProject/fe-wap-yidianling-index/.git/index.lock': File exists.

Another git process seems to be running in this repository, e.g.
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.

尝试的解决办法

删除 .git/index.lock文件,但是一使用webstorm打开项目, .git/index.lock 文件就会自动生成,关闭webstrom后该文件又没有了

阅读 6.7k
1 个回答

方案一:
重装git,最彻底

方案二:
git是多进程的,
webstorm内置git命令面板,git bash也是独立的;
分别查看两个git的内容是否有奔溃地方,该提交的提交

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题