使用git commit命令时遇到 fatal: Unable to create index.lock File exists 错误的解决办法

来源:互联网 发布:网管监控软件 编辑:程序博客网 时间:2024/05/21 22:29

一、问题描述

使用git commit 命令提交代码,遇到下面的错误:

$ git commit -m 'Test'fatal: Unable to create 'D:/MyProject/.git/index.lock': File exists.If no other git process is currently running, this probably means agit process crashed in this repository earlier. Make sure no other gitprocess is running and remove the file manually to continue.

二、解决办法

在项目根目录下找到 .git 文件夹。打开该文件夹。找到文件夹里面的index.lock 文件,将其删除,即可解决问题。

解决办法参考 这个问答 里面 Ryan S 的回答。

0 0
原创粉丝点击