如何在gitbash中停止正在运行的进程

3

我正在尝试使用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.

错误来自于 add 而不是 push。由 git commit 打开的编辑器:我认为这是在告诉你,当你编辑某个提交的提交消息时,你留下了一个进程(例如 vim)。你通常使用什么编辑器来编辑消息?如果是 vim,你是如何关闭它的? - Paolo
可能重复问题: https://dev59.com/oGsz5IYBdhLWcg3wfn66 - Daemon Painter
1个回答

3

当我遇到同样的问题时,我找到了一个解决方案,即:
rm -f ./.git/index.lock
请尝试一下。
谢谢...


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接