lock重命名为索引失败

lock重命名为索引失败

本文介绍了从index.lock重命名为索引失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用GitHub Windows客户端,我做了一个 sync 以将远程更改提取到本地计算机,但在完成同步之前,我的磁盘空间不足,同步失败。现在,我似乎有一堆本地更改,实际上是从原点拉出的更改。我试图运行git pull,但得到:

Using the GitHub Windows client I did a sync to pull remote changes to my local machine, but before finishing the sync, I ran out of disk space and the sync failed. Now I seem to have a bunch of local changes that are actually changes that were being pulled from origin. I tried to run git pull but got:

C:\Users\Tom\SourceLog [master +4 ~26 -0 !]> git pull
Updating b3a86e1..5afd74f
error: Your local changes to the following files would be overwritten by merge:
        SourceLog.Interface/IChangedFile.cs
        SourceLog.Interface/ILogEntry.cs
        ...
Please, commit your changes or stash them before you can merge.
error: The following untracked working tree files would be overwritten by merge:
        Lib/MSBuildExtensionPack/4.0.6.0/Ionic.Zip.dll
        Lib/MSBuildExtensionPack/4.0.6.0/MSBuild.ExtensionPack.dll
        ...
Aborting

所以现在我试图放弃本地更改,但我得到:

So now I'm trying to discard the local changes but I'm getting:

C:\Users\Tom\SourceLog [master +4 ~26 -0 !]> git checkout -- .
Rename from '.git/index.lock' to '.git/index' failed. Should I try again? (y/n) y
Rename from '.git/index.lock' to '.git/index' failed. Should I try again? (y/n) n
fatal: unable to write new index file

我该如何清理这个? (在开始同步之前,我没有任何本地更改。)

How can I clean this up? (I didn't have any local changes before starting the sync.)

无法显示

Can't seem to reset head..

C:\Users\Tom\SourceLog [master +4 ~0 -0 !]> git reset head
Rename from '.git/index.lock' to '.git/index' failed. Should I try again? (y/n) y
Rename from '.git/index.lock' to '.git/index' failed. Should I try again? (y/n) n
error: Could not write new index file.
fatal: Could not reset index file to revision 'head'.


推荐答案

看起来下面的过程对 .git\index file:

Looks like the following process had a lock on the .git\index file:

ssh-agent.exe
C:\Users\Tom\AppData\Local\GitHub\PortableGit_8810fd5c2c79c73adcc73fd0825f3b32fdb816e7\bin\ssh-agent.exe

我杀了这个进程并运行了 git reset HEAD ,看起来我现在恢复了正常。

I killed the process and ran git reset HEAD and looks like I'm back to normal now.

这篇关于从index.lock重命名为索引失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 22:26