挂在“POST git-receive-pack (chunked)”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10790232/
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
Hanging at "POST git-receive-pack (chunked)"
提问by Antony Woods
I will be honest, I know very little about the internals of git.
老实说,我对 git 的内部结构知之甚少。
I have staged and commit a 40mb directory, but when I come to push...
我已经上演并提交了一个 40mb 的目录,但是当我开始推送时......
$ git push --verbose --progress
Pushing to https://[email protected]/acron0/project.git
Password for 'https://[email protected]':
POST git-receive-pack (chunked)
It's been like this for 20 minutes. I am assuming it's hanging but...is there anything I can do to find out why?
就这样持续了 20 分钟。我假设它挂了但是......我能做些什么来找出原因吗?
回答by Scott Hooper
This is a bug in Git; when using HTTPS it will use chunked encoding for uploads above a certain size. Those do not work.
这是 Git 中的一个错误;使用 HTTPS 时,它将使用分块编码来上传超过特定大小的内容。那些不起作用。
A trivial fix is to tell git to not chunk until some ridiculously large size value, such as:
一个微不足道的解决方法是告诉 git 在一些大得离谱的值之前不要分块,例如:
git config http.postBuffer 524288000
回答by Adam Dymitruk
Probably your credentials. Use the git+ssh protocol instead of https.
可能是您的凭据。使用 git+ssh 协议而不是 https。
回答by amergin
Using SourceTree to push to BitBucket I get this error once every few months. It turns out that I just have to wait an extra five minutes and it sorts itself out. It looks like it has hanged and the temptation is to just cancel and try again but maybe hang in there a bit longer. I know that this is answered already but my commits amounted to maybe a couple of hundred kb rather than the 40mb the original poster is talking about.
使用 SourceTree 推送到 BitBucket 我每隔几个月就会收到一次此错误。事实证明,我只需要再等五分钟,它就会自行解决。看起来它已经挂了,诱惑是取消并重试,但可能会在那里停留更长时间。我知道这已经得到了回答,但我的提交量可能只有几百 kb,而不是原始海报所谈论的 40mb。
回答by VonC
With Git 2.13 (Q2 2017), you will be able to set http.postBuffer
to a really large number (i.e, larger than ulong
on some platforms).
使用 Git 2.13(2017 年第二季度),您将能够设置http.postBuffer
为一个非常大的数字(即比ulong
某些平台上的更大)。
See commit 37ee680(11 Apr 2017) by David Turner (csusbdt
).
(Merged by Junio C Hamano -- gitster
--in commit 4c01f67, 24 Apr 2017)
请参阅David Turner ( ) 的commit 37ee680(2017 年 4 月 11 日)。(由Junio C Hamano合并-- --在commit 4c01f67,2017 年 4 月 24 日)csusbdt
gitster
http.postbuffer
: allow full range ofssize_t
valuesUnfortunately, in order to push some large repos where a server does not support chunked encoding, the
http postbuffer
must sometimes exceed two gigabytes.
On a 64-bit system, this is OK: we just malloc a larger buffer.This means that we need to use CURLOPT_POSTFIELDSIZE_LARGE to set the buffer size.
http.postbuffer
: 允许全范围的ssize_t
值不幸的是,为了在服务器不支持分块编码的情况下推送一些大型存储库,
http postbuffer
有时必须超过 2 GB。
在 64 位系统上,这没问题:我们只是分配了一个更大的缓冲区。这意味着我们需要使用 CURLOPT_POSTFIELDSIZE_LARGE 来设置缓冲区大小。
回答by Richard Le Mesurier
If you found this site because of BitBucket failing with that error message, then check out the answers to this one:
如果您因为 BitBucket 失败并显示该错误消息而找到此站点,请查看此站点的答案:
Particularly the comment by Nicholas Pickeringand Simon Tewsiabout exactly what part of the key needs to be pasted into the BitBucket dialog.
特别是Nicholas Pickering和Simon Tewsi关于需要将密钥的哪一部分粘贴到 BitBucket 对话框中的评论。