git clone
Q:
1 error: RPC failed; curl 56 GnuTLS recv error (-54): Error in the pull function.
2 fatal: The remote end hung up unexpectedly
3 fatal: 过早的文件结束符(EOF)
4 fatal: index-pack 失败
A:
法一:git config --global http.postBuffer 20000000
法二:
修改配置文件
gedit ~/.bashrc
然后在配置文件的最下面加上这三行
export GIT_TRACE_PACKET=1
export GIT_TRACE=1
export GIT_CURL_VERBOSE=1
然后保存退出后运行:source ~/.bashrc 是配置文件生效
Q:
fatal: unable to access 'https://github.com/...'
A:
法一:
git config --global -l # 查看git配置
如果您有与https代理相关的内容,如例如https_proxy = …,请将其从〜/ .gitconfig文件中删除,然后重试。
env|grep -i proxy # 检查环境变量
取消设置https_proxy
法二:
在开启shadowsocks的前提下,手动配置git的代理。git客户端输入如下两个命令就可以了。
git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy http://127.0.0.1:1080
http://也可以改成sockets5://,但是区别在于:socks5不支持通过pubkey免密登录github,每次提交代码只能输入用户名和密码。http可以支持免密登录。
取消代理:
git config --global --unset http.proxy
git config --global --unset https.proxy