文章目录
克隆github仓库前的设置
国内访问github很慢且不稳定,直接git clone大概率失败,需要设置代理:
1. 购买代理服务且用软件设置好
此时能通过网页访问github,但是不能通过命令行(Git bash)克隆仓库
2. Git bash上设置代理:
git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy http://127.0.0.1:1080
注意:代理服务器地址需要在windows系统代理设置上查看,比如我的:
3. 代理软件上(比如ShadowsocksR)设置代理规则为全局
报错信息
开启代理(默认代理规则:绕过局域网和大陆,未在git bash上设置代理)
报错:Failed to connect to github.com port 443: Timed out
fatal: unable to access 'https://github.com/madler/zlib.git/': Failed to connect to github.com port 443: Timed out
开启代理(默认代理规则:绕过局域网和大陆,在git bash上设置了代理)
报错:OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
fatal: unable to access 'https://github.com/madler/zlib.git/': OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
开启代理(代理规则:全局,且在git bash上设置了代理)
git clone 成功
remote: Enumerating objects: 5324, done.
remote: Counting objects: 100% (172/172), done.
remote: Compressing objects: 100% (91/91), done.
remote: Total 5324 (delta 83), reused 140 (delta 79), pack-reused 5152
Receiving objects: 100% (5324/5324), 3.91 MiB | 5.18 MiB/s, done.
Resolving deltas: 100% (3697/3697), done.