git / cygwin无声失败

时间:2013-03-02 16:08:56

标签: git cygwin

我在bitbucket上有一个个人/私人存储库,我正在尝试克隆。当我从Ubuntu框中克隆时,我能够克隆存储库:

$ git clone https://<user>@bitbucket.org/<user>/<repo>.git
Cloning into '<repo>'...
Password for 'https://<user>@bitbucket.org':
remote: Counting objects: 586, done.
remote: Compressing objects: 100% (519/519), done.
remote: Total 586 (delta 65), reused 583 (delta 65)
Receiving objects: 100% (586/586), 2.55 MiB | 650 KiB/s, done.
Resolving deltas: 100% (65/65), done.

然而,当我从cygwin尝试相同的命令时,我得到了一个无声的失败:

$ git clone -v --progress https://<user>@bitbucket.org/<user>/<repo>.git
Cloning into <repo>...

然后git退出。我花了一个小时试图追踪这一点,但沉默的错误很难谷歌。

我尝试过的事情:

  • 在cygwin中重新安装git
  • 降级cygwin中的git
  • 删除并重建.gitconfig文件
  • echo $?打印141(可能与SIGPIPE有关?)
  • 设置GIT_CURL_VERBOSE没有产生任何添加的输出

注意:git版本是1.7.5.1

有没有人对这里可能发生的事情有任何见解?

修改/更新

在找不到问题的解决方案之后,我完全重新安装了cygwin,问题似乎已经消失了。

3 个答案:

答案 0 :(得分:2)

我遇到了这个问题,对我来说,它是cygcurl-4.dll的狡猾版本,我已编译并安装到/ usr / local / bin。我删除了该文件,现在git起作用了。

我的修复程序的细节可能与其他人不同,但这就是我进行调试的方式。 Cygwin现在有strace的基本版本,但我不确定它来自哪个软件包。

为了跟踪子进程的生成(除其他外),我使用了strace --mask=sigp git clone https://github.com/<user>/<repo>.git。翻阅,我发现了这个障碍:

--- Process 12224 created
  922    5807 [main] git 11849! child_info_spawn::worker: new process name \\?\C:\cygwin64\usr\libexec\git-core\git-remote-https.exe
--- Process 12224 loaded C:\Windows\System32\ntdll.dll at 0000000077830000
   25    5832 [main] git 11849! child_info_spawn::worker: spawned windows pid 12224
   41    5873 [main] git 11849! child_info::sync: n 2, waiting for subproc_ready(0x188) and child process(0x178)
--- Process 12224 loaded C:\Windows\System32\kernel32.dll at 0000000077610000
--- Process 12224 loaded C:\Windows\System32\KernelBase.dll at 000007fefd870000
--- Process 12224 loaded C:\cygwin64\usr\local\bin\cygcurl-4.dll at 0000000482aa0000
--- Process 12224 loaded C:\cygwin64\bin\cygcrypto-1.0.0.dll at 00000003d5120000
--- Process 12224 loaded C:\cygwin64\bin\cygwin1.dll at 0000000180040000
--- Process 12224 loaded C:\cygwin64\bin\cygz.dll at 00000003b0490000
--- Process 12224 loaded C:\cygwin64\bin\cygrtmp-0.dll at 00000003ac650000
--- Process 12224 loaded C:\cygwin64\bin\cygssl-1.0.0.dll at 00000003ab640000
--- Process 12224 loaded C:\cygwin64\bin\cygssh2-1.dll at 00000003ab6b0000
--- Process 12224, exception c0000139 at 00000000778f8078
--- Process 12224 exited with status 0xc0000139

然后是所有出口清理。因此,在为/usr/libexec/git-core/git-remote-https.exe加载DLL的过程中会出现问题。 Cygwin通常不会告诉您很多有关这些错误的信息,但是如果您“使用Windows”启动该程序,则会显示一个错误框。

cygstart /usr/libexec/git-core/git-remote-https.exe弹出一个框,显示

The procedure entry point curl_global_sslset could not be located
in the dynamic link library cygcurl-4.dll.

使用cygcheck /usr/libexec/git-core/git-remote-https.exe检查要尝试加载的库:

C:\cygwin64\usr\libexec\git-core\git-remote-https.exe
  C:\cygwin64\usr\local\bin\cygcurl-4.dll
    C:\cygwin64\bin\cygcrypto-1.0.0.dll
      C:\cygwin64\bin\cygwin1.dll
        C:\Windows\system32\KERNEL32.dll
          C:\Windows\system32\ntdll.dll
          C:\Windows\system32\KERNELBASE.dll

          (... many more Windows 7 DLLs ...)

      C:\cygwin64\bin\cygz.dll
    C:\cygwin64\bin\cygrtmp-0.dll
      C:\cygwin64\bin\cygssl-1.0.0.dll
    C:\cygwin64\bin\cygssh2-1.dll
  C:\cygwin64\bin\cygiconv-2.dll
  C:\cygwin64\bin\cygintl-8.dll

因此,手动安装的C:\cygwin64\usr\local\bin\cygcurl-4.dll很可能是候选者,将其删除可以解决我的问题。

答案 1 :(得分:1)

作为一种解决方法,请考虑安装Github for Windows,在资源管理器中右键单击要克隆的目录,然后在此处选择Git Bash。然后,使用Git Bash克隆存储库。有趣的是,Cygwin git,Windows的Github和Git Bash都可以访问相同的存储库(它们与相同的.git目录进行交互),因此它们不会互相破坏。如果Git Bash中的clone成功,您可以在Cygwin中进行常规操作。

在该目录中获取工作git的第四个选项是使用vagrant。

答案 2 :(得分:0)

我遇到了同样的问题。

安装<a>包解决了我的问题。