尽管运行 gc 和修剪,但所有关键的 git 命令都会挂起

  • 本文关键字:git 命令 挂起 gc 运行 修剪 git
  • 更新时间 :
  • 英文 :


在我的 Windows 10 机器上通过 cmder 终端,每个重要的 git 命令现在都完全挂起。我还没有等超过 5 分钟就取消了。

例如,git pull 将无限期挂起。然后我将按 ctrl+c,当我运行 git status 时(这没有问题),我会看到文件正在更新。但是,git 日志中不会显示任何提交。

Git 结帐也挂起了,什么也没发生。

我不知道如何解决这个问题。我已经运行了 git prune、git gc 和 git fsck --无法访问。当我运行 git fsck 时,什么都没有出现 - 无法访问或 git fsck 根本没有,当我运行 git 修剪时,它刚刚完成但什么也没修复。Git gc 也完成了,但没有修复任何内容。

编辑:运行strace git checkout <branch>

λ strace git checkout develop
--- Process 28092 created
--- Process 28092 loaded C:WindowsSystem32ntdll.dll at 00007ffa2c0b0000
--- Process 28092 loaded C:WindowsSystem32kernel32.dll at 00007ffa29710000
--- Process 28092 loaded C:WindowsSystem32KernelBase.dll at 00007ffa28a10000
--- Process 28092 loaded C:WindowsSystem32msvcrt.dll at 00007ffa29670000
--- Process 28092 thread 16828 created
--- Process 28092 loaded C:WindowsSystem32shell32.dll at 00007ffa29dc0000
--- Process 28092 loaded C:WindowsSystem32cfgmgr32.dll at 00007ffa29290000
--- Process 28092 loaded C:WindowsSystem32ucrtbase.dll at 00007ffa29190000
--- Process 28092 thread 25116 created
--- Process 28092 loaded C:WindowsSystem32SHCore.dll at 00007ffa2b5c0000
--- Process 28092 loaded C:WindowsSystem32rpcrt4.dll at 00007ffa29a70000
--- Process 28092 loaded C:WindowsSystem32combase.dll at 00007ffa292e0000
--- Process 28092 loaded C:WindowsSystem32bcryptprimitives.dll at 00007ffa281a0000
--- Process 28092 thread 19616 created
--- Process 28092 loaded C:WindowsSystem32windows.storage.dll at 00007ffa28220000
--- Process 28092 loaded C:WindowsSystem32msvcp_win.dll at 00007ffa28970000
--- Process 28092 loaded C:WindowsSystem32sechost.dll at 00007ffa2b380000
--- Process 28092 loaded C:WindowsSystem32advapi32.dll at 00007ffa29c80000
--- Process 28092 loaded C:WindowsSystem32profapi.dll at 00007ffa28130000
--- Process 28092 loaded C:WindowsSystem32powrprof.dll at 00007ffa280b0000
--- Process 28092 loaded C:WindowsSystem32shlwapi.dll at 00007ffa29ba0000
--- Process 28092 loaded C:WindowsSystem32gdi32.dll at 00007ffa29a30000
--- Process 28092 loaded C:WindowsSystem32gdi32full.dll at 00007ffa28f70000
--- Process 28092 loaded C:WindowsSystem32user32.dll at 00007ffa2b420000
--- Process 28092 loaded C:WindowsSystem32win32u.dll at 00007ffa29170000
--- Process 28092 loaded C:WindowsSystem32kernel.appcore.dll at 00007ffa28110000
--- Process 28092 loaded C:WindowsSystem32cryptsp.dll at 00007ffa28180000
--- Process 28092 loaded C:WindowsSystem32imm32.dll at 00007ffa29a00000
--- Process 28092 loaded C:UsersdontdoxplsDesktopcmdervendorconemu-maximus5ConEmuConEmuHk64.dll at 00007e1100000000
--- Process 25040 created
--- Process 25040 loaded C:WindowsSystem32ntdll.dll at 00007ffa2c0b0000
--- Process 25040 loaded C:WindowsSystem32kernel32.dll at 00007ffa29710000
--- Process 25040 loaded C:WindowsSystem32KernelBase.dll at 00007ffa28a10000
--- Process 25040 thread 28028 created
--- Process 25040 thread 9448 created
--- Process 25040 thread 26428 created
--- Process 25040 loaded C:WindowsSystem32advapi32.dll at 00007ffa29c80000
--- Process 25040 loaded C:UsersdontdoxplsDesktopcmdervendorgit-for-windowsmingw64binlibintl-8.dll at 0000000061cc0000
--- Process 25040 loaded C:UsersdontdoxplsDesktopcmdervendorgit-for-windowsmingw64binlibiconv-2.dll at 0000000066000000
--- Process 25040 loaded C:WindowsSystem32msvcrt.dll at 00007ffa29670000
--- Process 25040 loaded C:UsersdontdoxplsDesktopcmdervendorgit-for-windowsmingw64binlibpcre-1.dll at 0000000069140000
--- Process 25040 loaded C:WindowsSystem32msvcrt.dll at 0000000001a20000
--- Process 25040 loaded C:WindowsSystem32sechost.dll at 00007ffa2b380000
--- Process 25040 unloaded DLL at 0000000001a20000
--- Process 25040 loaded C:UsersdontdoxplsDesktopcmdervendorgit-for-windowsmingw64binzlib1.dll at 0000000062e80000
--- Process 25040 loaded C:WindowsSystem32rpcrt4.dll at 00007ffa29a70000
--- Process 25040 loaded C:WindowsSystem32user32.dll at 00007ffa2b420000
--- Process 25040 loaded C:WindowsSystem32win32u.dll at 00007ffa29170000
--- Process 25040 loaded C:WindowsSystem32gdi32.dll at 00007ffa29a30000
--- Process 25040 loaded C:WindowsSystem32gdi32full.dll at 00007ffa28f70000
--- Process 25040 loaded C:WindowsSystem32msvcp_win.dll at 00007ffa28970000
--- Process 25040 loaded C:WindowsSystem32ucrtbase.dll at 00007ffa29190000
--- Process 25040 loaded C:WindowsSystem32ws2_32.dll at 00007ffa2b310000
--- Process 25040 loaded C:UsersdontdoxplsDesktopcmdervendorgit-for-windowsmingw64binlibssp-0.dll at 0000000068ac0000
--- Process 25040 loaded C:WindowsSystem32imm32.dll at 00007ffa29a00000
--- Process 25040 loaded C:WindowsSystem32cryptsp.dll at 00007ffa28180000
--- Process 25040 loaded C:WindowsSystem32rsaenh.dll at 00007ffa27250000
--- Process 25040 loaded C:WindowsSystem32bcrypt.dll at 00007ffa28e90000
--- Process 25040 loaded C:WindowsSystem32cryptbase.dll at 00007ffa27b10000
--- Process 25040 loaded C:WindowsSystem32bcryptprimitives.dll at 00007ffa281a0000
--- Process 25040 loaded C:UsersdontdoxplsDesktopcmdervendorconemu-maximus5ConEmuConEmuHk64.dll at 00007e1100000000
--- Process 25040 thread 25204 created
--- Process 25040 thread 21648 created
--- Process 25040 thread 16420 created
--- Process 25040 thread 28384 created
--- Process 25040 thread 21212 created
--- Process 25040 thread 8304 created
--- Process 25040 thread 5732 created
--- Process 25040 thread 19088 created
--- Process 25040 thread 15156 created
--- Process 25040 thread 29212 created
--- Process 25040 thread 29892 created
--- Process 25040 thread 28188 created
--- Process 25040 thread 28292 created
--- Process 25040 thread 20504 created
--- Process 25040 thread 1768 created
--- Process 25040 thread 14520 created
--- Process 25040 thread 16080 created
--- Process 25040 thread 24820 created
--- Process 25040 thread 28384 exited with status 0x0
--- Process 25040 thread 1768 exited with status 0x0
--- Process 25040 thread 28292 exited with status 0x0
--- Process 25040 thread 20504 exited with status 0x0
--- Process 25040 thread 16080 exited with status 0x0
--- Process 25040 thread 14520 exited with status 0x0
--- Process 25040 thread 15156 exited with status 0x0
--- Process 25040 thread 24820 exited with status 0x0
--- Process 25040 thread 8304 exited with status 0x0
--- Process 25040 thread 21648 exited with status 0x0
--- Process 25040 thread 28188 exited with status 0x0
--- Process 25040 thread 19088 exited with status 0x0
--- Process 25040 thread 21212 exited with status 0x0
--- Process 25040 thread 29892 exited with status 0x0
--- Process 25040 thread 5732 exited with status 0x0
--- Process 25040 thread 29212 exited with status 0x0
--- Process 25040 thread 16420 exited with status 0x0
--- Process 25040 thread 19684 created

这不是完整的输出。当我编辑这个问题时,一些线程退出了。所以它挂在线程创建上?

编辑:这绝对也不是一个cmder问题。我刚刚运行了 git bash,遇到了同样的问题。我做了GIT_TRACE=1 git checkout <branch>,它什么也没产生,只有这个

$ GIT_TRACE=1 git checkout develop
20:31:33.554953 exec-cmd.c:236          trace: resolved executable dir: C:/Program Files/Git/mingw64/bin
20:31:33.559955 git.c:419               trace: built-in: git checkout develop

编辑:通过重新启动计算机解决了该问题。我不确定为什么修复它或首先导致问题的原因。希望有人能找到解释。

此问题已通过重新启动我的 PC 得到解决。我不确定为什么修复它或首先导致问题的原因。希望有人能找到一个好的解释。

在设置简化的 PATH,首先尝试执行相同的命令,这些命令仍在 CmdEr 中(但也用于在常规 CMD 中进行测试):

set PATH=C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0
set GH=C:pathtogit
set PATH=%GH%bin;%GH%usrbin;%GH%mingw64bin;%PATH%

然后查看问题是否仍然存在。