最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】github.io的git的push非常慢

Git crifan 10891浏览 0评论

之前一直可以很正常的快速的push到github.io:

https://github.com/crifan/crifan.github.io

中的,但是最近几天,不知何故,速度极其的慢,慢到有时候会超时无法push。

比如现在又遇到了:

<code>➜  crifan.github.io git:(master) git push
Counting objects: 151, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (150/150), done.
Writing objects:   5% (9/151), 11.79 MiB | 15.00 KiB/s
</code>

去搜了下:

github.io push 太慢

有何方法可以给github远程仓库的push提速? – 知乎

工程基础 – Github pull/push 速度太慢 – CSDN博客

解决 git clone 或 git push 太慢的问题 | MinHow’s Blog

解决git停留在writing objects和上传慢的情况 – 简书

提高Github Clone速度 – 简书

handbook/通过代理工具提高Github Clone速度.md at master · jaywcjlove/handbook

此处试了试:

在自动翻墙的情况下,对于:

http://github.global.ssl.fastly.net

竟然无法打开:

参考:

提高Github Clone速度 – 简书

中的:

<code>151.101.72.249
192.30.253.112
</code>

先去ping看看:

<code>➜  ~ ping 151.101.72.249
PING 151.101.72.249 (151.101.72.249): 56 data bytes
64 bytes from 151.101.72.249: icmp_seq=0 ttl=50 time=179.080 ms
64 bytes from 151.101.72.249: icmp_seq=1 ttl=50 time=183.084 ms
64 bytes from 151.101.72.249: icmp_seq=2 ttl=50 time=180.142 ms
^C
--- 151.101.72.249 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 179.080/180.769/183.084/1.694 ms
➜  ~ ping 192.30.253.112
PING 192.30.253.112 (192.30.253.112): 56 data bytes
64 bytes from 192.30.253.112: icmp_seq=0 ttl=48 time=329.578 ms
64 bytes from 192.30.253.112: icmp_seq=1 ttl=48 time=329.495 ms
64 bytes from 192.30.253.112: icmp_seq=2 ttl=48 time=331.895 ms
^C
--- 192.30.253.112 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 329.495/330.323/331.895/1.112 ms
</code>

速度虽然慢,但是都可以连上

再去打开:

http://151.101.72.249

显示内容:

<code>Fastly error: unknown domain: 151.101.72.249. Please check that this domain has been added to a service.
Details: cache-nrt6124-NRT
</code>

访问:

192.30.253.112

的确就是github.com

所以,去试试

先去确认本地的ss的代理:

所以去设置:

<code>➜  crifan.github.io git:(master) git config --global https.proxy socks5://127.0.0.1:1086
➜  crifan.github.io git:(master) git config --global http.proxy socks5://127.0.0.1:1086
➜  crifan.github.io git:(master) cat ~/.gitconfig
[user]
    name = naturling_crifan
    email = [email protected]
[core]
    excludesfile = /Users/crifan/.gitignore_global
    autocrlf = input
    askpass = git-gui--askpass
[difftool "sourcetree"]
    cmd = opendiff \"$LOCAL\" \"$REMOTE\"
    path =
[mergetool "sourcetree"]
    cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
    trustExitCode = true
[push]
    default = simple
[http]
    proxy = socks5://127.0.0.1:1086
[https]
    proxy = socks5://127.0.0.1:1086
</code>

然后重新push看看速度有没有变化

<code>➜  crifan.github.io git:(master) git push
Counting objects: 151, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (150/150), done.
Writing objects:   7% (11/151), 26.58 MiB | 2.01 MiB/s
</code>

速度立马爆快,都超过1MB/s了。。

【总结】

此处:

  • 之前:github.io的push速度很快,正常速度,忘了速度具体多少,但是肯定有几十,几百KB/s之类的

  • 现在:github.io的push速度极其的慢,比如只有几KB/s,甚至都不到1KB/s -》 慢到超时

原因:

未知,不知道为何突然push就很慢了。

解决办法:

给git全局设置此处的(ss的)sock5代理:

先去ss中确认sock5的代理的地址和端口:

可见是:

  • 地址:127.0.0.1

  • 端口:1086

然后去用git命令行设置:

<code>git config --global https.proxy socks5://127.0.0.1:1086
git config --global http.proxy socks5://127.0.0.1:1086
</code>

即可。

然后速度就正常了:

此处可达 1~2MB/s

提醒:

之前参考别人资料,看错端口,用了1080了:

<code>➜  crifan.github.io git:(master) git config --global http.proxy socks5://127.0.0.1:1080
➜  crifan.github.io git:(master) git config --global https.proxy socks5://127.0.0.1:1080
</code>

导致后续git push出错:

<code>➜  crifan.github.io git:(master) git push
fatal: unable to access 'https://github.com/crifan/crifan.github.io.git/': Failed to connect to 127.0.0.1 port 1080: Connection refused
</code>

-》所以要注意看清楚自己的sock5的地址和端口,不要搞错了。

转载请注明:在路上 » 【已解决】github.io的git的push非常慢

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
83 queries in 0.192 seconds, using 22.23MB memory