路径/.git/index.lock': File exists."/>
git fatal: Unable to create '/我的项目路径/.git/index.lock': File exists.
在拉取主分支:git pull origin master时,第一次出现了如下的问题,也是我第一次遇见这样的问题
提示我们:无法创建'/users/lidongbin/code/store/store api/.git/index.lock':文件存在
错误如下:
fatal: Unable to create '/Users/lidongbin/code/store/store-api/.git/index.lock': File exists.
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.
截图如下
通过查找资料,有2个直观的解决方法
- 进入.git目录删除index.lock文件,删除后再commit会自动再次生成index.lock
- 在.git同级目录,执行rm -f .git/index.lock (或者rm -f git/index.lock)------笔者使用的解决方案
再次pull master 。 OK!!!!
更多推荐
git fatal: Unable to create '/我的项目路径/.git/index.lock': File exists.
发布评论