github 相关的 push pull clone 都很慢,挂代理了 clone 也只有 100kb/s 的速度,有什么解决办法么

2022-08-29 16:40:07 +08:00
 Renco
4396 次点击
所在节点    程序员
39 条回复
wmrrr
2022-08-29 16:42:40 +08:00
试试全局代理
conateri
2022-08-29 16:44:35 +08:00
clash for windows 的 TUN Mode
herozzm
2022-08-29 16:44:53 +08:00
host 修改大法?
AmoreLee
2022-08-29 16:46:50 +08:00
clone 的链接有 https 和 ssh 的,可以都试试。有时其中一种可能会更快一些。

另外 git 似乎不会走全局代理,需要 git config 配置一下,可以参考一下:

https://c1rew.github.io/2019/05/19/git-clone-%e5%8a%a0%e9%80%9f/
sprite82
2022-08-29 16:47:38 +08:00
git config --global http.proxy socks5://127.0.0.1:7890
placeholder
2022-08-29 16:51:39 +08:00
得用 git 命令设置代理,光挂上代理是没用的

记得设置代理的时候端口号要看代理软件设置的端口号是多少,要对应上才行
cvbnt
2022-08-29 16:59:54 +08:00
cfw 的 tun 模式
CrazyMonkeyV
2022-08-29 17:03:05 +08:00
CrazyMonkeyV
2022-08-29 17:04:23 +08:00
完整了写了 git clone 使用代理的流程,按照步骤来,不可能慢
ysc3839
2022-08-29 17:04:26 +08:00
@sprite82 git 底层使用 libcurl 发送 http 请求,而 libcurl 的代理使用 socks5://时会在本地解析 DNS ,应该改成 socks5h://
https://curl.se/libcurl/c/CURLOPT_PROXY.html
zx9481
2022-08-29 17:06:26 +08:00
hervey0424
2022-08-29 17:06:53 +08:00
再.gitconfig 中添加代理
mazai
2022-08-29 17:17:42 +08:00
如果是用 ssh 的方式,可以使用挂个 ssh 代理

vim ~/.ssh/config
添加如下行:
#ssh proxy
ProxyCommand nc -v -x 127.0.0.1:7890 %h %p
sprite82
2022-08-29 17:20:36 +08:00
@ysc3839 感谢,涨知识了
Renco
2022-08-29 17:33:42 +08:00
git 代理配置也加了,可能是代理比较慢吧。换 ssh 会好一点点
cheng6563
2022-08-29 17:36:43 +08:00
http 基本是废的,换 ssh 就好了
Kevinyy
2022-08-29 17:43:03 +08:00
试试 这个命令:git clone --config http.proxy="http://127.0.0.1:7890" https://github.com/****/xxxx.;
licoycn
2022-08-29 17:45:36 +08:00
nekolr
2022-08-29 17:49:21 +08:00
Proletariused
2022-08-29 17:51:38 +08:00
试试 [ghproxy]( https://ghproxy.com/)

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/876241

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX