Tom*_*ter 35 windows git github windows-7
使用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
Run Code Online (Sandbox Code Playgroud)
所以现在我想丢弃当地的变化,但我得到了:
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
Run Code Online (Sandbox Code Playgroud)
我该如何清理它?(在开始同步之前,我没有任何本地更改.)
似乎无法重置头..
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'.
Run Code Online (Sandbox Code Playgroud)
Tom*_*ter 27
看起来以下进程锁定了.git\index
文件:
ssh-agent.exe
C:\Users\Tom\AppData\Local\GitHub\PortableGit_8810fd5c2c79c73adcc73fd0825f3b32fdb816e7\bin\ssh-agent.exe
Run Code Online (Sandbox Code Playgroud)
我杀了这个过程跑了git reset HEAD
,看起来我现在已恢复正常了.
tha*_*s.a 26
就我而言,我必须关闭从WSL Ubuntu 终端打开的VS代码。code .
Dim*_*gog 15
在我的情况下,这是由管理员和非管理员命令提示使用相同的Git repo引起的.当last git pull
来自admin cmd时,它index
是由它创建的,然后非admin cmd没有足够的权限来修改它.
我的解决方案是重新创建index
(同时保持工作树完好无损):
del .git\index
git reset --mixed head
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
36686 次 |
最近记录: |