Git clone return result=18 code=200 在特定存储库上
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12236415/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Git clone return result=18 code=200 on a specific repository
提问by Nitay
I'm trying to clone a internal repository from our company repository, and I keep getting this error:
我正在尝试从我们公司的存储库中克隆一个内部存储库,但我不断收到此错误:
error: RPC failed; result=18, HTTP code = 200
It always happens only after the repository have been completely downloaded (It takes a while).
它总是在存储库完全下载后才会发生(需要一段时间)。
I've tried using torotiseGit. Here is the report:
我试过使用 torotiseGit。这是报告:
git.exe clone --progress -v "http://path/repository.git" "C:\Users\user\Documents\code\repository"
Cloning into 'C:\Users\user\Documents\code\repository'...
POST git-upload-pack (424 bytes)
remote: Compressing objects: 100% (4895/4895)
Receiving objects: 100% (6970/6970), 61.89 MiB | 4.82 MiB/s
Resolving deltas: 100% (2610/2610)
Resolving deltas: 100% (2610/2610), done.
remote: Total 6970 (delta 2610), reused 5702 (delta 1672)
error: RPC failed; result=18, HTTP code = 200
git did not exit cleanly (exit code 128)
I've tried several times, from a Linux machine and from a windows machine. Same error
我从 Linux 机器和 Windows 机器上尝试过几次。同样的错误
How can i further investigate the error? I couldn't find any useful information on Google
我如何进一步调查错误?我在 Google 上找不到任何有用的信息
EDIT: I've checked the Apache logs on the Git server - There is a GET and a POST (with result 200) corresponding to each clone. The POST is a bit big (60MB) - So I've tried increasing the postBuffer to 500MB, but the error still occurs
编辑:我检查了 Git 服务器上的 Apache 日志 - 每个克隆都有一个 GET 和一个 POST(结果为 200)。POST 有点大 (60MB) - 所以我尝试将 postBuffer 增加到 500MB,但错误仍然发生
Could this really be a git bug?
这真的是一个 git 错误吗?
I wish it gave more informative errors...
我希望它提供更多信息性错误...
回答by andygavin
The error: RPC failed; result=18, HTTP code = 200is a libcurl error.
错误:RPC 失败;result=18, HTTP code = 200是 libcurl 错误。
From http://curl.haxx.se/libcurl/c/libcurl-errors.htmlwe can see this is:
从http://curl.haxx.se/libcurl/c/libcurl-errors.html我们可以看到这是:
CURLE_PARTIAL_FILE (18)
A file transfer was shorter or larger than expected. This happens when the server first reports an expected transfer size, and then delivers data that doesn't match the previously given size.
CURLE_PARTIAL_FILE (18)
文件传输比预期短或大。当服务器首先报告预期的传输大小,然后传送与先前给定的大小不匹配的数据时,就会发生这种情况。
You can set GIT_CURL_VERBOSE=1 before running a command like clone to understand how libcurl is failing. This might be done in bash with:
您可以在运行像 clone 这样的命令之前设置 GIT_CURL_VERBOSE=1 以了解 libcurl 是如何失败的。这可以在 bash 中完成:
GIT_CURL_VERBOSE=1 git clone --progress -v ...
However given the error above you should try adjusting http.postBuffer. Try:
但是,鉴于上述错误,您应该尝试调整http.postBuffer。尝试:
git config --global http.postBuffer 524288000
From here https://www.kernel.org/pub/software/scm/git/docs/git-config.html
从这里https://www.kernel.org/pub/software/scm/git/docs/git-config.html
回答by Roman Bulgakov
I had same problem on Windows machines (cant pull or clone remote repo) while working with git remote server over http (not https) - solution I found to this problem: On desktop machine (where error occurred) reason for this was an antivirus software (Kaspersky Internet Security 2013 in my case) so I put into exceptions the following git components:
我在 Windows 机器上遇到了同样的问题(不能拉或克隆远程仓库),同时通过 http(不是 https)使用 git 远程服务器 - 我发现这个问题的解决方案:在台式机上(发生错误的地方)这是一个防病毒软件(在我的案例中为 Kaspersky Internet Security 2013)所以我将以下 git 组件置于异常中:
Exception Rules:
例外规则:
- C:\Program Files (x86)\Git\bin\git.exe | all
- C:\Program Files (x86)\Git\bin\curl.exe |all
- C:\Program Files (x86)\Git* |all
- C:\Program Files (x86)\Git\git-cheetah* |all
- C:\Program Files (x86)\Git\bin\git.exe | 全部
- C:\Program Files (x86)\Git\bin\curl.exe |全部
- C:\Program Files (x86)\Git* |全部
- C:\Program Files (x86)\Git\git-cheetah* |全部
Trusted software:
值得信赖的软件:
- C:\Program Files (x86)\Git\bin\git.exe
- C:\Program Files (x86)\Git\bin\curl.exe
- C:\Program Files (x86)\Git\bin\sh.exe
- c:\program files (x86)\git\libexec\git-core\git-remote-http.exe
- c:\program files (x86)\git\libexec\git-core\git-upload-pack.exe
- C:\Program Files (x86)\Git\bin\git.exe
- C:\Program Files (x86)\Git\bin\curl.exe
- C:\Program Files (x86)\Git\bin\sh.exe
- c:\program files (x86)\git\libexec\git-core\git-remote-http.exe
- c:\program files (x86)\git\libexec\git-core\git-upload-pack.exe
and tick all options to not interrupt them at all (no tracing of workflow and network activity) - after that the problem was gone away
并勾选所有选项以根本不中断它们(不跟踪工作流和网络活动) - 之后问题就消失了