Git报错:Another git process seems to be running in this repository

#事故现场

Git操作的时候突然报错:

Unable to create 'D:/xxx/.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.

Pull operation failed.

翻译:另一个git进程似乎正在这个存储库中运行,例如 由"git commit"打开的编辑器。请确保所有流程终止,然后重试。如果它仍然失败,一个git进程可能已在此存储库中崩溃:手动删除文件以继续。

#原因分析

方法一:找到.git/index.lock文件,直接删除即可;

如果在linux上的话,执行rm删除命令:

复制代码
rm -f .git/index.lock

方法二:执行git命令

复制代码
git clean -f .git/index.lock

方法三:自己去目录删除这个文件

测试以解决

相关推荐
橘子☆心酸2 小时前
Git 的自我修养
git·svn·gitee
李永奉9 小时前
Git和GitHub-用操作命令控制Git 分支的查看、创建、切换、合并与删除管理实操教程
git·github
71777714 小时前
SVN 迁移到 Git 用什么工具:git-svn、svn2git 与平台化方案的取舍
git·svn
李永奉1 天前
Git和GitHub-用操作命令控制Git的工作区、暂存区、本地仓库之间状态的提交教程
git·github
羊在吃青草1 天前
Git之远程仓库
git
凉、介2 天前
Git 深入理解(二) | 常用命令
大数据·git·elasticsearch
xuxie992 天前
GIT版本管理
git
茶栀(*´I`*)2 天前
Git从零开始操作清单
git
李永奉3 天前
Git和GitHub-Git 管理的版本数据到底保存在哪个文件夹里?
git·github
Mortalbreeze3 天前
Git 基础篇(二):本地仓库管理与常用操作
git