【Git】解决:E:/**/.git/index.lock': File exists

简介: 【Git】解决:E:/**/.git/index.lock': File exists

正文


今天提交代码时遇到了一个问题,导致我提交不了代码到gitlab上,报错如下所示:

19:59   Commit failed with error
            0 file committed, 4 files failed to commit: after guoqing
            Unable to create 'E:/company/workspace_database/update_jar/.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.


遇到这个问题,直接去把 E:/company/workspace_database/update_jar/.git/index.lock 删了,就解决了。其实这是 git 为了避免多进程同时提交上的一个锁。和linux里,我们使用 vim 编辑器时,会自动生成一个.swap文件一样的。


可见,原理都一样,但换了个场景,就不知道咋回事了,值得反思。

目录
相关文章
|
3月前
|
网络安全 开发工具 git
git修改提交路径以及强制提交——异常:error: remote origin already exists.与异常:error: failed to push some refs to的解决
git修改提交路径以及强制提交——异常:error: remote origin already exists.与异常:error: failed to push some refs to的解决
21 0
|
2月前
|
开发工具 git
git报错 Unable to create ‘D:/project/xxx/.git/index.lock‘: File exists.
git报错 Unable to create ‘D:/project/xxx/.git/index.lock‘: File exists.
95 1
|
3月前
|
开发工具 git
Git:error: remote origin already exists
Git:error: remote origin already exists
23 2
|
9月前
|
开发工具 git
git报错,error: You have not concluded your merge (MERGE_HEAD exists). hint: Please,
git报错,error: You have not concluded your merge (MERGE_HEAD exists). hint: Please,
87 0
|
开发工具 git
git报错:fatal: remote origin already exists.
git报错:fatal: remote origin already exists.
116 0
git报错:fatal: remote origin already exists.
|
开发工具 git
Git冲突:# If this is not correct, please remove the file # .git/MERGE_HEAD
Git冲突:# If this is not correct, please remove the file # .git/MERGE_HEAD
99 0
Git冲突:# If this is not correct, please remove the file # .git/MERGE_HEAD
|
开发工具 git
.git file too large question resolve解决方法
.git file too large question resolve解决方法
|
27天前
|
缓存 数据可视化 网络安全
Git命令大全
Git命令大全
58 1
|
1月前
|
开发工具 git
Git教程:深入了解删除分支的命令
【4月更文挑战第3天】
50 0
Git教程:深入了解删除分支的命令
|
2月前
|
存储 Shell Linux
【Shell 命令集合 文件管理】Linux git命令使用教程
【Shell 命令集合 文件管理】Linux git命令使用教程
34 0

相关实验场景

更多