github 代理加速或 CDN 加速


下面的命令只針對github.com,在國內還可能會用到gitee.com,所以不能將所有的 git 站點都添加上代理。

# 設置代理
git config --global http.https://github.com.proxy socks5://127.0.0.1:1086
# 取消代理
git config --global --unset http.https://github.com.proxy

如果沒有代理也不要急,有專門的cdn加速:

git config --global url."https://github.com.cnpmjs.org".insteadOf "https://github.com"
git config --global url."https://ghproxy.com/https://github.com".insteadOf "https://github.com" 

或者:

git config --global url."https://hub.fastgit.xyz/".insteadOf "https://github.com/"

cdn 加速二選一使用。

但因為沒有官方 CDN,上面兩個都是用愛發電,沒准哪天就掛了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM