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