-
博文分类专栏
- Jquery基础教程
-
- 文章:(15)篇
- 阅读:46560
- shell命令
-
- 文章:(42)篇
- 阅读:154228
- Git教程
-
- 文章:(36)篇
- 阅读:234845
- leetCode刷题
-
- 文章:(76)篇
- 阅读:131788
-
报错fatal: Unable to create '.git/index.lock': File exists.解决办法2018-05-06 15:44 阅读(11254) 评论(0)
在使用git操作的时候,报错fatal: Unable to create '.git/index.lock': File exists.如下:
fatal: Unable to create '/home/dequan/test/.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.
导致报错的原因:git在进行比较费时的操作时候,会在.git目录下面创建一个index.lock文件,相当于一个文件锁,防止重复的操作。当操作结束后,会删除index.lock文件。当强制关闭进行中的git操作,这个文件可能不会自动删除。
解决办法:手动删除即可。
rm .git/index.lock