使用GitHub Windows客户端,我执行了同步以将远程更改拉到本地机器上,但在完成同步之前,我的磁盘空间用尽了,同步失败了。现在我似乎有一堆本地更改,实际上是从源代码库中拉取的更改。我尝试运行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
(或将其移动到其他地方,以防万一),然后再次尝试git reset --hard HEAD
。 - twalberg