目录
添加代理后的git设置
主要要设置端口:
# 打开https的9099端口代理
git config --global https.proxy https://127.0.0.1:9099
# git config --global --add remote.origin.proxy "127.0.0.1:9099"
# 打开http的9099端口代理 (sock5协议)
git config --global http.proxy 'socks5://127.0.0.1:9099'
# 打开https的9099端口代理 (sock5协议)
git config --global https.proxy 'socks5://127.0.0.1:9099'
其中,1080是代理软件设置的代理端口;
如果不进行上述设置,可能会出现下面的问题:
Failed to connect to github.com port 443: Timed out
OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
另外,如果代理设置错误,有可能会报下面的问题:
gnutls_handshake() failed: The TLS connection was non-properly terminated.
解决方法为重置代理:
git config --global --unset https.https://github.com.proxy
git config --global --unset http.https://github.com.proxy
然后再正确设置代理
git认证错误
报错:
Logon failed, use ctrl+c to cancel basic credential prompt.
git: ‘credential-manager-core’ is not a git command. See ‘git --help’.
输入正确的账号密码后仍无法解决;
解决方案:升级git
windows: git update-git-for-windows
Linux/Unix: git update
Ubuntu服务器上git配置 (非root用户)
1 打开sslocal服务;
2. 此时打开的是socks5i端口;
3. 正确配置代理,如:
(base) username@gpu01:~$ git config --global --list
user.email=username@xx.com
user.name=username
https.proxy=socks5://127.0.0.1:9099
http.proxy=socks5://127.0.0.1:9099
pull错误:git pull fails “unable to resolve reference” “unable to update local ref”
先
rm .git/refs/remotes/origin/master
再
git pull
即可
未完待续