我正在尝试从公司存储库中克隆内部存储库,并且我一直收到此错误:
error: RPC failed; result=18, HTTP code = 200
Run Code Online (Sandbox Code Playgroud)
它总是在存储库完全下载后才会发生(需要一段时间).
我尝试过使用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)
Run Code Online (Sandbox Code Playgroud)
我已经尝试了几次,从Linux机器和Windows机器.同样的错误
我该如何进一步调查错误?我在Google上找不到任何有用的信息
编辑:我已经检查了Git服务器上的Apache日志 - 每个克隆都有一个GET和一个POST(结果为200).POST有点大(60MB) - 所以我尝试将postBuffer增加到500MB,但错误仍然发生
这真的是一个git bug吗?
我希望它能提供更多信息......
and*_*vin 13
错误:RPC失败; result = 18,HTTP代码= 200是libcurl错误.
从http://curl.haxx.se/libcurl/c/libcurl-errors.html我们可以看到:
CURLE_PARTIAL_FILE(18)
文件传输比预期的更短或更长.当服务器首次报告预期的传输大小,然后传递与先前给定大小不匹配的数据时,会发生这种情况.
您可以在运行像clone这样的命令之前设置GIT_CURL_VERBOSE = 1,以了解libcurl是如何失败的.这可以在bash中完成:
GIT_CURL_VERBOSE=1 git clone --progress -v ...
Run Code Online (Sandbox Code Playgroud)
但是,鉴于上述错误,您应该尝试调整http.postBuffer.尝试:
git config --global http.postBuffer 524288000
Run Code Online (Sandbox Code Playgroud)
从这里https://www.kernel.org/pub/software/scm/git/docs/git-config.html
小智 3
我在通过 http(不是 https)使用 git 远程服务器时在 Windows 计算机上遇到了同样的问题(无法拉取或克隆远程存储库) - 我发现这个问题的解决方案:在桌面计算机上(发生错误的地方)原因是防病毒软件(在我的例子中是卡巴斯基安全软件 2013)所以我将以下 git 组件放入例外:
并勾选所有选项以完全不中断它们(不跟踪工作流程和网络活动)-之后问题就消失了