国内访问 GitHub 速度较慢,可以通过配置代理来加速访问。还有个方式,找个国内的托管平台,比如码云、Coding 等。配置对应的构建流水线,将代码同步到 GitHub。
用了很多年的coding
,界面简洁,近期发布公告,免费版不能继续用了,需要迁移到腾讯的新平台cnb
,顺带吐槽下,阿里的托管平台,整个界面设计,班味很重。
仓库迁移
cnb
官网提供了迁移工具,可以批量将代码从github
迁移到cnb
。
https://docs.cnb.cool/zh/guide/migration-tools.html
Git 配置代理
不配置加速,工具同步很慢,代码会先同步到本地,然后上传到远程仓库。
Git 可以通过以下命令单独配置 HTTP 代理,不影响系统全局设置:
# 设置 HTTP 代理
git config --global http.proxy http://proxy.example.com:8080
# 设置 HTTPS 代理
git config --global https.proxy http://proxy.example.com:8080
# 可选:仅为特定域名设置代理
git config --global http.https://github.com.proxy http://proxy.example.com:8080
如果需要取消代理配置,可以使用:
git config --global --unset http.proxy
git config --global --unset https.proxy
查看当前代理配置:
git config --global --get http.proxy
git config --global --get https.proxy