Git-致命:无法创建“ /path/my_project/.git/index.lock”:文件存在

霸气de小男生 提交于 2020-04-27 09:03:26

问题:

I am still getting this error message, when I try to move my project tree on to git repo. 当我尝试将项目树移至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: 我检查了此项目的目录权限,这些权限设置在777上。在带有my_project目录的终端中,我设置了:

git init git初始化

and then if I try 然后,如果我尝试

git add . git添加

or 要么

git commit -m "first upload" git commit -m“首次上传”

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. 我试过也创建一个新的仓库,并提交它,但是不幸的是仍然是同样的错误信息。

What is the cause of problem? 问题原因是什么?


解决方案:

参考一: https://stackoom.com/question/WywJ/Git-致命-无法创建-path-my-project-git-index-lock-文件存在
参考二: https://oldbug.net/q/WywJ/Git-fatal-Unable-to-create-path-my-project-git-index-lock-File-exists
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!