Update github-awsdownload-host.md
This commit is contained in:
@ -1,6 +1,9 @@
|
||||
### host
|
||||
|
||||
将以下host复制进`C:\Windows\System32\drivers\etc\hosts`,再使用命令行(cmd) `ipconfig /flushdns`刷新dns缓存。
|
||||
将以下host复制进`C:\Windows\System32\drivers\etc\hosts`,再使用命令行(cmd) `ipconfig /flushdns`刷新dns缓存。
|
||||
目的:此host只为解除红色镰刀锤对GitHub(asw、ssh)下载及克隆的网络限制干扰
|
||||
|
||||
详情 [关于Github克隆及下载过慢的解决方案](https://hoodiearon.github.io/note/2019/10-01/4ee4554a.html)
|
||||
|
||||
```
|
||||
## GitHub Start
|
||||
@ -55,4 +58,52 @@
|
||||
```
|
||||
附加速小工具:http://www.toolzl.com/tools/githubjiasu.html
|
||||
|
||||
<!--此host只为解除红色镰刀锤对GitHub(asw、ssh)下载的网络限制干扰-->
|
||||
<!--
|
||||
|
||||
**说在前面:这些问题都可以使用VPN直接解决,但由于红朝特殊环境,找到合适性价比的VPN又是一件比较困难的事,更不用说免费的了,而且免费的基本都赶尽杀绝了...**
|
||||
|
||||
## Github 下载过慢处理(releases)
|
||||
|
||||
关于releases,它可以是压缩包如zip、7z等格式;也可以是软体程式,比方说:exe、msi
|
||||
|
||||
1. 打开[www.ipaddress.com](https://www.ipaddress.com/),查询以下链接的DNS解析地址
|
||||
|
||||
```
|
||||
github.com
|
||||
assets-cdn.github.com
|
||||
github.global.ssl.fastly.net
|
||||
|
||||
# 下载链接 raw.githubusercontent.com 的实际地址
|
||||
codeload.github.com
|
||||
```
|
||||
|
||||
2. 记录下查询到的IP地址,并添加进入`C:\Windows\System32\drivers\etc\Hosts`文件
|
||||
3. 运行`cmd`输入`ipconfig /flushdns` 指令刷新系统DNS
|
||||
|
||||
## Git Clone 克隆过慢改进
|
||||
|
||||
### 浅克隆
|
||||
|
||||
git clone 默认会下载项目的完整历史版本,若只关心最新的代码,而不关心之前的历史,可以使用浅复制功能:
|
||||
|
||||
```
|
||||
$ git clone --depth=1 https://github.com/你的用户名/你的repo.git
|
||||
```
|
||||
|
||||
`--depth=1` 表示只下载最近一次的版本,使用浅复制可以大大减少下载的数据量,这样即使在红色网络环境下,也可以快速的获得代码;若之后想获取完整历史信息,可以使用指令 `$ git fetch --unshallow`
|
||||
|
||||
### 代理方案
|
||||
|
||||
```
|
||||
# 代理设置
|
||||
git config --global http.proxy 'socks5://127.0.0.1:1080'
|
||||
git config --global https.proxy 'socks5://127.0.0.1:1080'
|
||||
# 取消代理
|
||||
git config --global --unset https.proxy 'socks5://127.0.0.1:1080'
|
||||
git config --global --unset http.proxy 'socks5://127.0.0.1:1080'
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
-->
|
||||
|
||||
Reference in New Issue
Block a user