gpt4 book ai didi

windows - Git 从 index.lock 重命名为索引失败

转载 作者:IT王子 更新时间:2023-10-29 00:59:57 37 4
gpt4 key购买 nike

我使用 GitHub Windows 客户端进行了同步,以将远程更改 pull 到我的本地计算机,但在完成同步之前,我用完了磁盘空间并且同步失败。现在我似乎有一堆本地更改,这些更改实际上是从源中提取的更改。我尝试运行 git pull 但得到了:

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

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

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

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

更新

似乎无法重置头部..

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 文件:

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

我终止了进程并运行了 git reset HEAD 看起来我现在恢复正常了。

关于windows - Git 从 index.lock 重命名为索引失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13635429/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com