git和GitHub的http协议问题
在运行git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions这个命令时,报错了
致命错误:无法访问 ‘https://github.com/zsh-users/zsh-autosuggestions/’:HTTP/2 stream 1 was not closed cleanly before end of the underlying stream
原因是
因为git默认使用http/2.0协议,而github还是http/1.1 。 git
默认使用的通信协议时http/1.0,可以通过将默认通信协议修改为 http/1.1
来解决该问题
执行命令
git config --global http.version HTTP/1.1
之后在运行上面命令,即可成功拉取。