Git 错误提示Another git process seems to be running in this repository, e.g.
在操作git切换分支的时候,遇到一个错误:
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在使用过程中遇到了崩溃,部分被上锁的资源你没有被释放导致的。
解决方案: 进入项目文件夹下,隐藏的 .git文件夹中找到后缀名为.lock的文件,删除即可。