git 提交失败

git Commit failed

我在 git commit

期间遇到以下错误

Commit failed with error 0 files committed, 3 files failed to commit: Unable to create 'C:/xampp/htdocs/project/.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操作同时运行

尝试删除 index.lock 文件以解锁进一步的操作:

rm -f .git/index.lock

或者如果有更多的锁定文件:

 rm -f .git/*.lock