我的 git push 在显示完成推送后挂起。我要去 推送
Counting objects: 51, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (47/47), done.
Writing objects: 100% (47/47), 27.64 MiB | 6.47 MiB/s, done.
Total 47 (delta 4), reused 0 (delta 0)
它卡在这里,我必须按 control-c 才能返回命令行。我过去对这个项目做了几次没有问题的 promise 。我在我的机器上尝试过其他 repo 协议(protocol),它们工作正常。这是怎么回事?
最佳答案
https://git-scm.com/docs/git-config#Documentation/git-config.txt-httppostBuffer
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.
Note that raising this limit is only effective for disabling chunked transfer encoding and therefore should be used only where the remote server or a proxy only supports HTTP/1.0 or is noncompliant with the HTTP standard. Raising this is not, in general, an effective solution for most push problems, but can increase memory consumption significantly since the entire buffer is allocated even for small pushes.
分辨率
将 Git 缓冲区大小增加到您的存储库的最大单个文件大小
git config --global http.postBuffer 157286400
引用Git push fails - client intended to send too large chunked body的决议用于 ngnix 反向代理配置。将此参数增加到您的存储库的最大单个文件大小。
按照 Can't clone or pull due to a git outbound proxy 中的说明绕过出站代理
关于git push 在 Total 行后挂起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15843937/