关于git的错误

写完代码以后,不能继续提交,错误显示是这样的。

1
fatal: Unable to create '/Users/Demo/.git/index.lock': File exists.
2
3
Another git process seems to be running in this repository, e.g.
4
an editor opened by 'git commit'. Please make sure all processes
5
are terminated then try again. If it still fails, a git process
6
may have crashed in this repository earlier:
7
remove the file manually to continue.

大致意思是,有个其他进程在操作这个仓库,所以无法继续提交。

只需要删除index.lock文件即可。

1
rm .git/index.lock