英文:
Can't commit - '.git/index.lock': File exists. Even though, there is no file like that
问题
在尝试提交和推送时出现错误:
似乎在此存储库中有另一个 Git 进程正在运行,例如由 'git commit' 打开的编辑器。请确保所有进程已终止,然后再试一次。如果仍然失败,可能是此存储库中的 Git 进程之前崩溃了:请手动删除文件以继续。
我尝试过的方法:
- 查找并删除该文件 - 在此存储库中没有名为 index.lock 的文件。它不存在,既不在 .git 文件夹中,也不在 git/refs/head/my_branch 中(是的,显示了隐藏文件,是的,我尝试过使用 sudo)。
- 完全删除存储库,然后再次克隆它,然后提交。
- 终止所有 Git 进程。
- 强制重启计算机。
- 删除 .git/COMMIT_EDITMSG - 没有这样的文件。
没有结果。
英文:
Getting an error when trying to commit and push:
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.
What I tried:
- finding that file and deleting it - there is no file index.lock in this repo. It is not there, neither in the .git folder nor in git/refs/head/my_branch (yes, hidden files are shown, yes I tried through sudo).
- completely delete the repo and clone it once again, and then committing.
- kill all of the git processes.
- hard reset of computer.
- rm .git/COMMIT_EDITMSG - no such file
No result.
答案1
得分: 1
错误与问题的真正原因无关。花时间与我根本不应该“战斗”的东西,哈哈。
我执行了ga . & gcmsg "updated" && gp
,而不是ga . && gcmsg "updated" && gp
。可能对某人有帮助。
英文:
the error has nothing to do with the real cause of the problem. Spend time "fighting" with what I am not suppose to "fight" at all, lol.
I did ga . & gcmsg "updated" && gp
instead of ga . && gcmsg "updated" && gp
🤣
Maybe will be helpful for someone.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论