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
删除此文件即可