【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文件一样的。


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

目录
相关文章
|
开发工具 git
git 使用之remote: File [4e21e71a555febaa4dfaaa05cf7eeb606ea96ae2] size 104.090MB, exceeds quota 100MB remote: Please remove the file[s] from history and try again 报错如何解决-优雅草卓伊凡
git 使用之remote: File [4e21e71a555febaa4dfaaa05cf7eeb606ea96ae2] size 104.090MB, exceeds quota 100MB remote: Please remove the file[s] from history and try again 报错如何解决-优雅草卓伊凡
1199 3
git 使用之remote: File [4e21e71a555febaa4dfaaa05cf7eeb606ea96ae2] size 104.090MB, exceeds quota 100MB remote: Please remove the file[s] from history and try again 报错如何解决-优雅草卓伊凡
|
网络安全 开发工具 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的解决
1042 0
|
开发工具 git
unable to index file ‘~$git提交版本号.xlsx‘
unable to index file ‘~$git提交版本号.xlsx‘
|
Shell 网络安全 开发工具
fatal: unable to access 'https://github.com/wolfcw/libfaketime.git/': Encountered end of file
fatal: unable to access 'https://github.com/wolfcw/libfaketime.git/': Encountered end of file
|
开发工具 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.
2440 1
|
开发工具 git
Git:error: remote origin already exists
Git:error: remote origin already exists
644 2
|
开发工具 git
git报错:fatal: remote origin already exists.
git报错:fatal: remote origin already exists.
678 0
git报错:fatal: remote origin already exists.
|
开发工具 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,
884 0
|
开发工具 git
error: could not lock config file .git/config: Permission denied/Command failed with exit 255
error: could not lock config file .git/config: Permission denied/Command failed with exit 255
1167 0
|
11月前
|
开发工具 git
Git版本控制工具合并分支merge命令操作流程
通过以上步聚焦于技术性和操作层面指南(guidance), 可以有效管理项目版本控制(version control), 并促进团队协作(collaboration).
2738 15