解决chromium.googlesource(raw.githubusercontent.com)在国内无法通过git下载的问题

发表于 2024-03-29
更新于 2024-07-21
分类于 技术专栏
阅读量 318
字数统计 855

1、问题

我在使用Clash for Windows时浏览器可以访问chromium.googlesource的代码,但是用git clone 下载不了,这是因为虽然开了代理,但是git 下载的流量并没有走VPN(不知道为啥?)

2、解决办法

给git配置代理:

1git config --global https.proxy '127.0.0.1:7890' 2git config --global http.proxy '127.0.0.1:7890' 3

记得http和https的代理都要配置,因为你不清楚他们内部请求的链接都有哪些协议!

想取消代理的话也很简单:

1git config --global --unset https.proxy 2git config --global --unset http.proxy

之后再执行:gclient config https://chromium.googlesource.com/v8/v8即可。

下载Chrome源码的正确操作路径参考:https://chromium.googlesource.com/chromium/src/+/main/docs/mac_build_instructions.md#Get-the-code

3、同样的问题也发生在下载raw.githubusercontent.com的代码

在电脑安装zshell或者homebrew都会借助githubserconten.com,但是这个也会报和google一样的错误,这个时候的配置略有些不一样:

1export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:789

公众号关注一波~

微信公众号

关于评论和留言

如果对本文 解决chromium.googlesource(raw.githubusercontent.com)在国内无法通过git下载的问题 的内容有疑问,请在下面的评论系统中留言,谢谢。

网站源码:linxiaowu66 · 豆米的博客

Follow:linxiaowu66 · Github