本文介绍了Git - 致命:无法创建'/path/my_project/.git/index.lock':文件存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试将我的项目树移至git repo时,仍然收到此错误消息。



我使用这个项目检查了我的目录的权限,这些权限设置在777.在终端中的 my_project

然后如果我尝试

所以我会得到错误

 致命:无法创建'/ path / my_proj /.git/index.lock':文件存在。 

如果当前没有其他git进程正在运行,这可能意味着
git进程早些时候在此存储库中崩溃。确保没有其他的git
进程正在运行,并手动删除文件以继续。

我也尝试创建一个新的回购库,并提交它,但不幸的是仍然有相同的错误消息。 ..我已经有点绝望了,我试着在下午找到解决方案,但仍然没有成功......

任何人都可以帮助我,请问,问题的原因是什么?



百万次感谢!

解决方案

尝试

  rm -f ./.git/index.lock 

在您的存储库目录中。错误消息对于通常会导致它的原因相当明确,所以如果没有其他正在运行的git进程(这是正常情况),请继续并删除该文件。


I am still getting this error message, when I try to move my project tree on to git repo.

I checked the permissions of my directory with this project and these are set on 777. In terminal in the directory with my_project I set:

and then if I try

or

so I'll get the error

fatal: Unable to create '/path/my_proj/.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.

I tried also create a new repo and there to commit it, but unfortunately still the same error message... I am a bit desperate of it already, I try to find the solution whole afternoon, but still without succes...

Could anyone help me, please, what is the cause of problem?

Million times thanks!

解决方案

Try

rm -f ./.git/index.lock

In your repository directory. The error message is rather explicit as to what causes it typically, so if you have no other git processes running (which is the normal case), go ahead and delete that file.

这篇关于Git - 致命:无法创建'/path/my_project/.git/index.lock':文件存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 09:16