如何解决.git/index.lock:文件存在

问题描述 投票:0回答:1

我正在尝试使用 gitbash 将项目推送到 Github。我已经对该项目进行了一些更改,但不是在我的本地计算机上,而是直接在 Github 网站上。现在我尝试从我的计算机推送项目更新,但收到错误消息

$ git add
fatal: Unable to create 'C:/Users/JJ/.git/index.lock': File exists.


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.
git git-bash
1个回答
3
投票

当我面临同样的问题时。我找到了一个解决方案,它是

rm -f ./.git/index.lock

请尝试一下。
谢谢你...

© www.soinside.com 2019 - 2024. All rights reserved.