gitee解决github下载速度过慢
gitee解决github下载速度过慢
一般在github上下载代码都比较慢,可以考虑通过gitee来下载。一般有名的项目基本上都有人迁移到gitee,如果在gitee上没有找到或者是找到了版本比较旧的话可以自己将项目导入到gitee(前提是自己已经注册了gitee的账号)。注册账号就省略不说了。
gitee导入github项目
在 gitee 上注册完账号登录后,点击右上角 +
可以看到有新建仓库和从github/gitlab导入仓库。新建仓库中也能导入github/gitlab的项目。
导入仓库
点击从github/gitlab导入仓库,然后直接将github的url地址(网址)粘贴过来
可以看到都提示gitee上已经有类似仓库了,这个时候你可以选择别人的仓库,当然你可以自己导入。另外有一个是否开源的选择,
选择私有就只有自己可见,选择公开就是所有人可见(git clone的时候公开的项目不需要输入用户名和密码,私有的项目只能输入自己的用户名账户才能 clone)。最后导入仓库即可
如果仓库有子模块
在git clone 之后,使用
git submodule update --init --recursive
然后直接修改.git/config文件 将所有子模块的github地址替换成gitee地址,当然子模块也会有子模块,所以也需要替换地址
举例如下
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
[remote "origin"]
url = https://gitee.com/mirrors/pytorch.git
fetch = +refs/heads/*:refs/remotes/origin/*
[submodule "third_party/NNPACK_deps/FP16"]
active = true
url = https://gitee.com/brother_even/FP16.git
[submodule "third_party/NNPACK_deps/FXdiv"]
active = true
url = https://gitee.com/brother_even/FXdiv.git
[submodule "third_party/NNPACK"]
active = true
url = https://gitee.com/brother_even/NNPACK.git
[submodule "third_party/QNNPACK"]
active = true
url = https://gitee.com/brother_even/QNNPACK.git
[submodule "third_party/benchmark"]
active = true
url = https://gitee.com/mirrors/google-benchmark.git
[submodule "third-party/cpuinfo"]
active = true
url = https://gitee.com/brother_even/cpuinfo.git
[submodule "third_party/cub"]
active = true
url = https://gitee.com/brother_even/cub.git
[submodule "third_party/eigen"]
active = true
url = https://gitee.com/yy126/eigen.git
[submodule "third_party/fbgemm"]
active = true
url = https://gitee.com/brother_even/FBGEMM.git
[submodule "third_party/foxi"]
active = true
url = https://gitee.com/brother_even/foxi.git
[submodule "third_party/gemmlowp/gemmlowp"]
active = true
url = https://gitee.com/brother_even/gemmlowp.git
[submodule "third_party/gloo"]
active = true
url = https://gitee.com/brother_even/gloo.git
[submodule "third_party/googletest"]
active = true
url = https://gitee.com/qianjoe/google-googletest.git
[submodule "third_party/ideep"]
active = true
url = https://gitee.com/brother_even/ideep.git
[submodule "third_party/ios-cmake"]
active = true
url = https://gitee.com/brother_even/ios-cmake.git
[submodule "third_party/nccl/nccl"]
active = true
url = https://gitee.com/marenan/nccl.git
[submodule "third_party/neon2sse"]
active = true
url = https://gitee.com/xizhou748/ARM_NEON_2_x86_SSE.git
[submodule "third_party/onnx"]
active = true
url = https://gitee.com/qianjoe/onnx-onnx.git
[submodule "third_party/onnx-tensorrt"]
active = true
url = https://gitee.com/verigle/onnx-tensorrt.git
[submodule "third_party/protobuf"]
active = true
url = https://gitee.com/zeekim/protobuf.git
[submodule "third_party/NNPACK_deps/psimd"]
active = true
url = https://gitee.com/brother_even/psimd.git
[submodule "third_party/NNPACK_deps/pthreadpool"]
active = true
url = https://gitee.com/brother_even/pthreadpool.git
[submodule "third_party/pybind11"]
active = true
url = https://gitee.com/brt2/pybind11.git
[submodule "third_party/python-enum"]
active = true
url = https://gitee.com/brother_even/enum34.git
[submodule "third_party/python-peachpy"]
active = true
url = https://gitee.com/mirrors/peachpy.git
[submodule "third_party/python-six"]
active = true
url = https://gitee.com/mirrors/Python-Six.git
[submodule "third_party/sleef"]
active = true
url = https://github.com/zdevito/sleef.git
[submodule "third_party/tbb"]
active = true
url = https://gitee.com/mirrors/tbb.git
[submodule "third_party/zstd"]
active = true
url = https://gitee.com/swinghu/zstd.git
修改完后再下载所有的子模块,每次修改config文件都要输入以下命令来更新子模块
git submodule update --init --recursive