git命令出现fatal: Unable to create 'xxx/.git/index:File exists.问题

用git commit命令时,出现

fatal: Unable to create 'xxx/.git/index: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

猜你喜欢

转载自blog.csdn.net/hhhhhh5863/article/details/89210610