Git SVN 错误:Git 进程之前在存储库中崩溃
我只是想向 Git master 提交更改。从我读到的内容来看,这个想法似乎是删除锁定文件。消息说:
确保没有其他 Git 进程正在运行并手动删除该文件
也许有人知道要删除哪个文件以及如何删除?
I was just trying to commit changes to the Git master. From what I have read, it seems that the idea is to delete the lock file. The message says:
make sure no other Git processes are running and remove the file manually
Perhaps someone knows, which file to remove and how to remove?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(11)
有问题的文件可能是
.git/index.lock
并且它 如果没有其他 git 进程在运行,那么删除它应该是安全的。确保 git-svn 命令没有挂起。PS 我修复 git-svn 问题的常用方法是重新拉取存储库。虽然很耗时,但您可以在尝试解决问题的同时进行此操作。你和 git 来一场小小的竞赛吧。当然,这仅在您没有未推送的提交时才有效。
The file in question is likely
.git/index.lock
and it should be safe to just remove it if you have no other git processes running. Make sure a git-svn command isn't hanging.PS My usual approach to fixing git-svn problems is to make a fresh pull of the repository. Time consuming, but you can do it in parallel with trying to fix the problem. Have a little race between you and git. Of course, this only works if you didn't have unpushed commits.
您可以通过运行 rm -f ./.git/index.lock 来删除它。
rm 命令用于删除(删除)文件和目录。
-f
代表强制,告诉您的计算机删除文件而不提示确认You can remove it by running
rm -f ./.git/index.lock
The
rm
command is used to remove (delete) files and directories.The
-f
stands for force which tells your computer to remove the files without prompting for confirmation对于像我这样的“GUI”用户
打开 Git 扩展并选择存储库(如果有多个)
从顶部菜单中选择“设置”,然后选择“Git Maintenance”,然后单击“删除索引锁定”
Git 扩展:设置 -> Git 维护 -> 删除索引锁定
For "GUI" user like me
Open Git Extension and choose repository (if more than one)
Choose "Settings" from top menu then "Git Maintenance" and then click on "Delete Index Lock"
Git Extensions: Settings->Git Maintenance->Delete Index Lock
它还可能涉及 .git/ 中的任何 *.lock 文件,
检查并删除它们。您可以使用:
rm -f ./.git/*.lock
It may also concern any *.lock files in .git/
Check and remove them. You may use:
rm -f ./.git/*.lock
您已经在终端的另一个选项卡中打开了提交
You have already opened a commit in another tab in the terminal
我只需按照以下步骤解决此错误:-
它解决了这个问题
I solve this error by just following steps:-
It solve this Problem
@Joel 给出的答案有所帮助,但对于 Windows 用户,您可能必须启用显示隐藏文件/文件夹才能访问存在 index.lock 文件的 .git 文件夹。
如果您不知道如何启用隐藏文件夹,请使用此链接。
The answer giving by @Joel helped, except that for windows users you may have to enable show hidden files/folders to access .git folder where index.lock file exist.
Use this link in case you don't know how to enable hidden folders.
像 Schwern 所说的那样删除 index.lock 文件将解决这个问题。
您可以通过运行 rm -f ./.git/index.lock 来删除它。
rm 命令用于删除(删除)文件和目录。
-f 代表强制,它告诉你的计算机删除文件而不提示确认
仍然不起作用意味着通过 git bash 打开 git 而不是在终端中执行
Removing the index.lock file like Schwern stated will solve this problem.
You can remove it by running rm -f ./.git/index.lock
The rm command is used to remove (delete) files and directories.
The -f stands for force which tells your computer to remove the files without prompting for confirmation
still not working means open the git through git bash instead of doing in terminal
我遇到了这个问题,我什至无法找到
index.lock
。我的环境有点不同,是一个具有多个节点的集群。
该问题是在主节点中遇到的,我只是通过跳转到工作节点来解决它,因为主节点由所有连接的用户主持
I was facing the issue, and I couldn’t even able to find the
index.lock
.My environment was a little bit different, a cluster with multiple nodes.
The issue was encountered in the master node, and I solve it just by jumping to the worker node since the master node is chaired by all connected user
尽管没有 index.lock 文件,但我在 git bash 中遇到了这个问题。令人惊讶的是,“git pull”在 Windows 命令提示符中第一次运行。很棘手!
I was getting this issue in git bash although there was no index.lock file. Surprisingly, the "git pull" worked on first go in Windows command prompt. Tricky it was!
只需在项目路径前面输入
.git
即可。例如:
C:\DotNetAngularProject\MyApp\.git
您将获得文件列表和文件夹 文件名列表,如 HEAD、FETCH
删除
index.lock
手动归档。关闭您的项目&再次重新启动。
问题将会得到解决。
Just type
.git
Infront of the project path.For example:
C:\DotNetAngularProject\MyApp\.git
You will get list of files & folders list of file names like HEAD,FETCH
Delete
index.lock
file manually.Close your project & restart again.
Issue will be solved.