Github遇到的问题及解决办法
问题一
问题描述
HTTP/2 stream 1 was not closed cleanly before end of the underlying stream
问题原因
git默认使用http/2.0协议,而github还是http/1.1
解决办法
git config --global http.version HTTP/1.1
问题备注
查看git config的所有global配置
git config --global --list
问题二
问题描述
Failed to connect to github.com port 443 after 21068 ms: Couldn’t connect to server
问题原因
国内网络问题,需要魔法
解决办法
设置代理
git config --global http.proxy http://127.0.0.1:xxx(端口号)
此处的端口号需要与魔法的端口号一致
取消代理
git config --global unset http.proxy
问题备注
针对github 设置代理
git config --global http.https://github.com.proxy http://127.0.0.1:xxx(端口号)
取消github代理
git config --global --unset http.https://github.com.proxy