前情提要
日常访问 GitHub 的时候总是遇到进不去,要不然就是下载没速度/没反应,就很难受...不得不去开"魔法",但是又懒得去开.那就用得到 镜像GitHub 1,用 Git Bash Here 拉取代码到本地的时候还常常没反应..连接失败..链接超时,就很难受了
下面就给大家介绍一下镜像GitHub 和 git高速拉取代码到本地.
开始介绍
1. 镜像GitHub
<!--GitHub镜像下载站,不要登录!!!-->
https://hub.fastgit.xyz
首页不是GitHub的首页链接,不过不影响使用,因为内容是一致的,记得不要登录哦~(因为我也不知道登录了会怎么样,毕竟不是GitHub的官网链接),但是不登录也能直接找到项目链接进行下载比如:
- GitHub官方链接:https://github.com/Xhofe/alist
- fastgit镜像站链接: https://hub.fastgit.xyz/Xhofe/alist
使用就是这么简单,小伙伴要是有不错的也可以推荐给我喔~
2. Git Bash Here高速拉取
<!--GitHub高速下载,内附使用方法!!!-->
<!--主站点-->https://ghproxy.com/
<!--镜像站-->https://mirror.ghproxy.com/
高速下载方式很简单举个栗子:
git clone
wget & curl
- wget https://ghproxy.com/https://github.com/stilleshan/ServerStatus/archive/master.zip
- wget https://ghproxy.com/https://raw.githubusercontent.com/stilleshan/ServerStatus/master/Dockerfile
- curl -O https://ghproxy.com/https://github.com/stilleshan/ServerStatus/archive/master.zip
- curl -O https://ghproxy.com/https://raw.githubusercontent.com/stilleshan/ServerStatus/master/Dockerfile
3.修改hosts访问GitHub2
除了以上方法咱们也可以来修改hosts文件来进行访问,但是有时候还是不如上面的镜像站好使,不过有小伙伴想试试修改hosts来访问的话也是可以的,如果不知道怎么修改hosts的可以去看一下 前一篇文章 如何修改hosts文件.
hosts数据
# update: 20220222
# Github Hosts
# domain: github.com
140.82.113.4 github.com
140.82.114.9 nodeload.github.com
140.82.112.5 api.github.com
140.82.112.10 codeload.github.com
185.199.108.133 raw.github.com
185.199.108.153 training.github.com
185.199.108.153 assets-cdn.github.com
185.199.108.153 documentcloud.github.com
140.82.114.17 help.github.com
# domain: githubstatus.com
185.199.108.153 githubstatus.com
# domain: fastly.net
199.232.69.194 github.global.ssl.fastly.net
# domain: githubusercontent.com
185.199.108.133 raw.githubusercontent.com
185.199.108.154 pkg-containers.githubusercontent.com
185.199.108.133 cloud.githubusercontent.com
185.199.108.133 gist.githubusercontent.com
185.199.108.133 marketplace-screenshots.githubusercontent.com
185.199.108.133 repository-images.githubusercontent.com
185.199.108.133 user-images.githubusercontent.com
185.199.108.133 desktop.githubusercontent.com
185.199.108.133 avatars.githubusercontent.com
185.199.108.133 avatars0.githubusercontent.com
185.199.108.133 avatars1.githubusercontent.com
185.199.108.133 avatars2.githubusercontent.com
185.199.108.133 avatars3.githubusercontent.com
185.199.108.133 avatars4.githubusercontent.com
185.199.108.133 avatars5.githubusercontent.com
185.199.108.133 avatars6.githubusercontent.com
185.199.108.133 avatars7.githubusercontent.com
185.199.108.133 avatars8.githubusercontent.com
# End of the section
修改hosts文件的IP地址也可能过一段时间会失效...也是一种弊端吧,重新获取还得也麻烦.