git执行时报错
If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.

解决方案
原因:用SourceTree提交代码,发现这个问题。好像是因为上个进程没停止,造成文件不识别
解决:把仓库目录里的.git/index.lock文件(文件是隐藏的)删除就可以了。删除index.lock不会影响Git使用。是说index文件被锁住了,但是还有一个index文件要进行操作。
cd .git
ll
会找到index.lock文件

rm -rf index.lock
删除此文件即可

本文指导读者如何解决在SourceTree中遇到的Git进程崩溃问题,重点在于识别并删除隐藏的.git/index.lock文件以恢复Git操作,确保代码提交顺利进行。
985

被折叠的 条评论
为什么被折叠?



