我们的存储库已从 SVN 切换到 Git,这相当顺利。我们现在遇到的唯一麻烦是 Jenkins 拒绝获取我们的新 Git 存储库。我们的 Git 存储库托管在 Atlassian Stash 上,该存储库配置为公共(public)只读 http 存储库。
我试过很多东西,但都没有成功。 Git 存储库使用 Source Tree 和 Visual Studio 2013 正确获取。
Stash 在 Windows 8 计算机上作为“本地系统”用户下的一项服务运行。我已尝试将其配置为在已关闭压缩的本地用户帐户下运行 (core.compression 0)。
我尝试同时使用 C:\Program Files (x86)\Git\bin\git.exe
和 C:\Program Files (x86)\Git\cmd\git.exe
.
它产生的输出如下:
Receiving objects: 82% (19700/23879), 106.27 MiB | 6.00 KiB/s
fatal: early EOF
fatal: The remote end hung up unexpectedly
fatal: index-pack failed
error: RPC failed; result=56, HTTP code = 200
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1442)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1230)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:85)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:280)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:645)
... 10 more
虽然我尝试过使用早期版本的 Jenkins 和 GIT 插件,但它也无法使用最新的软件版本,即:
- git 版本 1.9.4.msysgit.2
- Jenkins 1.588
- GIT 客户端插件 1.11.1
- GIT 插件 2.2.7
最佳答案
您可以尝试通过增加 http 缓冲区大小来避免索引包:
git config --global http.postBuffer 1048576000
来自 git 手册:
http.postBuffer
Maximum size in bytes of the buffer used by smart HTTP transports when POSTing data to the remote system. For requests larger than this buffer size, HTTP/1.1 and Transfer-Encoding: chunked is used to avoid creating a massive pack file locally. Default is 1 MiB, which is sufficient for most requests.
这似乎违反直觉,但这通常有助于克隆和 pull 。
关于git - Jenkins 在获取 git 存储库时产生致命的 EOF,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26861784/