如果git提交 (push)或克隆 (clone)代码时,报如下的错误:

git-clone-or-push-hung-up-unexpectedly

可以尝试将http.postBuffer参数调大一点:

git config --global http.postBuffer 10M

通过git config --help可以看到http.postBuffer相关的解释:

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.

即,http.postBuffer参数是HTTP与远程系统交互的缓冲区大小,默认为1MiB(=1.048576MB)。


参考: