记录一次存储库中崩溃的git进程。搞不清为什么会出现这个问题,导致使用sourceTree无法进行文件暂存提交等问题。
Q(问题):
git -c diff.mnemonicprefix=false -c core.quotepath=false add -f -- ccclient/cocosstudio/ClubInviteTip.csd
fatal: Unable to create 'E:/work/XLClient/git/.git/index.lock': File exists.
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.
T(翻译):
git -c diff.mnemonicprefix = false -c core.quotepath = false add -f-ccclient / cocosstudio / ClubInviteTip.csd
致命:无法创建'E:/work/XLClient/git/.git/index.lock':文件存在。
如果当前没有其他git进程正在运行,则可能意味着
git进程在此存储库中崩溃。 确保没有其他git
进程正在运行,请手动删除文件以继续。
A(答案):
删除
index.lock
文件会解决这个问题。
可以通过运行rm -f ./.git/index.lock
rm
命令用于删除(删除)文件和目录。
-f
表示强制,它告诉计算机删除文件而不提示确认。