错误1
git push -u origin master
# fatal: unable to access 'https://github.com/xxx/xxx.git/': OpenSSL SSL_read: Connection was reset, errno 10054
解决办法:
SSL验证失败导致,可以直接禁止SSL验证
git config --global http.sslVerify "false"
官网关于http.sslVerify
的说明如下:
Whether to verify the SSL certificate when fetching or pushing over HTTPS. Defaults to true. Can be overridden by the GIT_SSL_NO_VERIFY environment variable.
错误2
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly
Everything up-to-date
解决办法:
- 缓存过小导致,可以尝试增大缓存
git config --global http.postBuffer 524288000
# 单位为byte, 524288000就是500M
官网关于 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 config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999
官网关于http.lowSpeedLimit
和http.lowSpeedTime
的说明:
If the HTTP transfer speed is less than http.lowSpeedLimit for longer than http.lowSpeedTime seconds, the transfer is aborted. Can be overridden by the GIT_HTTP_LOW_SPEED_LIMIT and GIT_HTTP_LOW_SPEED_TIME environment variables.
- 若传输文件实在太大,可以尝试增大压缩率(压缩率大小根据实际情况设置)
git config --global core.compression 3
官网关于core.compression
的说明:
An integer -1…9, indicating a default compression level. -1 is the zlib default. 0 means no compression, and 1…9 are various speed/size tradeoffs, 9 being slowest. If set, this provides a default to other compression variables, such as core.looseCompression and pack.compression.