关于Git无法提交 index.lock的解决办法(学)

Posted Java 学习

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了关于Git无法提交 index.lock的解决办法(学)相关的知识,希望对你有一定的参考价值。

今天提交代码时,在一次提交,莫名其妙没成功后,再次用git commit -a命令时,出现以下错误,无论是用git还是TortoiseGit都会出现以下这个问题。。

$ git commit -a
fatal: Unable to create ‘e:/git/android/XXXXXX/.git/index.lock‘: File exists.

If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.

 

解决办法:

找到index.lock 删除即可

 或者  cd .git

    del index.lock

以上是关于关于Git无法提交 index.lock的解决办法(学)的主要内容,如果未能解决你的问题,请参考以下文章