解決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的代碼目錄,執(zhí)行g(shù)it bash,增加如下:
git config --global http.proxy 'socks5://127.0.0.1:1080'
git config --global https.proxy 'socks5://127.0.0.1:1080'
shadowsocks的本地端口默認(rèn)是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.
會發(fā)現(xiàn)clone速度明顯上來了。

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容