git for windows 无法提交修改的处理

在git for windows里面不能commit修改,提示open shell

open shell以后,使用git add [filename],会报错:

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

网上查了一下,说输入命令: rm -f ./.git/index.lock, 尝试后发现是不行的,因为-f命令是个简写,可以尝试rm -force ./.git/index.lock

但其实这个报错的意思就是说 github目录下的的/.git/index.lock这个文件已经存在了,需要被删掉.所以可以直接手动进入/.git路径(它是隐藏文件夹,需要直接在路径里打),找到index.lock,然后手动删掉就ok了.

原文地址:https://www.cnblogs.com/liulangmao/p/3951654.html