当你想在github网站里面下载一个仓库时,可能会比较慢,下面提供下面几种方法。
-
直接解析url
github/gitlab的url可以直接在这解析:https://gitee.com/projects/import/url。
仓库没有依赖其他子模块(submodule
)时操作比较简单,有submodule
时稍复杂,详细方法看这个大佬的博客,除了解决submodule
的问题,还提到了下载github仓库的Release的小窍门。 -
镜像站点
可以去镜像站点https://gitee.com/mirrors,搜索一下看看有没有你想要的仓库,如果没有可以发邮件向工作人员申请。 -
指定 git bash 的端口号
很多时候,我们是用 git 终端 clone 代码。此时,如果有proxy,可以用如下代码设置 github 的下载端口:
(下面的1080是自己的proxy端口,请自行修改)git config --global http.https://github.com.proxy 127.0.0.1:1080 git config --global https.https://github.com.proxy 127.0.0.1:1080
如果想重置,则:
git config --global --unset http.https://github.com.proxy git config --global --unset https.https://github.com.proxy
对所有的网站(除了github,其他的如 gitlab 、gitee等)进行设置:
git config --global http.proxy 127.0.0.1:1080 git config --global https.proxy 127.0.0.1:1080
删除设置:
git config --global --unset http.proxy git config --global --unset https.proxy
最后,可以用
git config --global --list
,确认一下配置有没有被删除。