解决windows git clone太慢问题

1、在windows的如下下目录文件增加如下两条记录:
C:\Windows\System32\drivers\etc\hosts

151.101.72.249 http://global-ssl.fastly.Net
192.30.253.112 http://github.com

2、在windows要clone的代码目录,执行git bash,增加如下:
git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'
shadowsocks的本地端口默认是1080

3、重启电脑,让hosts文件生效

4、重新clone k8s代码:
$ git clone https://github.com/miracle-soul/kubernetes.git
Cloning into 'kubernetes'...
remote: Enumerating objects: 219, done.
remote: Counting objects: 100% (219/219), done.
remote: Compressing objects: 100% (128/128), done.
remote: Total 1051896 (delta 112), reused 91 (delta 91), pack-reused 1051677
Receiving objects: 100% (1051896/1051896), 657.58 MiB | 1.78 MiB/s, done.
Resolving deltas: 100% (749485/749485), done.
Updating files: 100% (21200/21200), done.
会发现clone速度明显上来了。

你可能感兴趣的:(解决windows git clone太慢问题)