Git下載加速教程


方法一

大家普遍采取的是更改本地的host文件,然后cmd命令刷新

1.訪問這里,依次獲取下面三個url的ping的ip

github.com
github.global.ssl.fastly.net
codeload.github.com

2.需要C:\Windows\System32\drivers\etc然后修改github相關的屬性為

192.30.253.113  github.com
151.101.25.194  github.global.ssl.fastly.net
192.30.253.121  codeload.github.com

3.執行ipconfig /flushdns命令,刷新 DNS 緩存。

方法二(推薦)

前期的准備:首先自己將代理開啟,系統代理模式改為全局模式

1.設置Git的代理方式

git config --global https.proxy http://127.0.0.1:1080

git config --global https.proxy https://127.0.0.1:1080

git config --global http.proxy 'socks5://127.0.0.1:1080' 

git config --global https.proxy 'socks5://127.0.0.1:1080'

2.取消(不建議)

git config --global --unset http.proxy

git config --global --unset https.proxy

3.通過Git命令來確認

git config --global --list

結果顯示

$ git config --global --list
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
user.name=**********             #用戶名
user.email=*********@gmail.com   #注冊郵箱
core.editor="D:\WDGJ\Sublime Text 3\sublime_text.exe" -w
http.http://github.com.proxy=http://127.0.0.1:1080
https.https://github.com.proxy=https://127.0.0.1:1080
http.proxy=http://127.0.0.1:1080

socks5的代理可以獲取這里

方法三

利用gitee來進行轉接下載,要求:一個github賬戶,一個碼雲gitee賬戶

  1. 將github上面你想要搞下來的項目首先 frok 到你自己的github的賬戶中去。耗時:一瞬間
  2. 登錄gitee,沒有的自行注冊。網頁中有添加項目的按鈕,一個加號。點擊加號,下拉列表里面有 遷移github項目 的選項,點開后按照提示關聯自己的github賬號,之后選擇你要遷移的項目,按提示操作。耗時:不到三分鍾。
  3. 按照 clone github項目方法, clone 遷移到gitee賬戶中的項目。區別是 clone 鏈接換成了目標項目在gitee中的鏈接。通常下載速度是以MB/s為單位的。

可以參考這位大佬的文章


免責聲明!

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



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