微女王 發表於 2021-2-10 17:24:00

gitee解决github下载速度过慢

<h1 id="gitee解决github下载速度过慢"><code>gitee解决github下载速度过慢</code></h1>
<p>一般在github上下载代码都比较慢,可以考虑通过gitee来下载。一般有名的项目基本上都有人迁移到gitee,如果在gitee上没有找到或者是找到了版本比较旧的话可以自己将项目导入到gitee(前提是自己已经注册了gitee的账号)。注册账号就省略不说了。</p>
<h2 id="gitee导入github项目"><code>gitee导入github项目</code></h2>
<p>在 gitee 上注册完账号登录后,点击右上角 +<br>
<img src="https://img2020.cnblogs.com/blog/2229220/202102/2229220-20210210164420381-288287813.png"><br>
可以看到有新建仓库和从github/gitlab导入仓库。新建仓库中也能导入github/gitlab的项目。</p>
<h3 id="导入仓库"><code>导入仓库</code></h3>
<p>点击从github/gitlab导入仓库,然后直接将github的url地址(网址)粘贴过来<br>
<img src="https://img2020.cnblogs.com/blog/2229220/202102/2229220-20210210172240803-1311282987.png"></p>
<p><img src="https://img2020.cnblogs.com/blog/2229220/202102/2229220-20210210172218754-695155565.png"></p>
<p>可以看到都提示gitee上已经有类似仓库了,这个时候你可以选择别人的仓库,当然你可以自己导入。另外有一个是否开源的选择,<br>
选择私有就只有自己可见,选择公开就是所有人可见(git clone的时候公开的项目不需要输入用户名和密码,私有的项目只能输入自己的用户名账户才能 clone)。最后导入仓库即可</p>
<h3 id="如果仓库有子模块"><code>如果仓库有子模块</code></h3>
<p>在git clone 之后,使用</p>
<pre><code>git submodule update --init --recursive
</code></pre>
<p>然后直接修改.git/config文件 将所有子模块的github地址替换成gitee地址,当然子模块也会有子模块,所以也需要替换地址<br>
举例如下</p>
<pre><code>
        repositoryformatversion = 0
        filemode = false
        bare = false
        logallrefupdates = true

        url = https://gitee.com/mirrors/pytorch.git
        fetch = +refs/heads/*:refs/remotes/origin/*

        active = true
        url = https://gitee.com/brother_even/FP16.git

        active = true
        url = https://gitee.com/brother_even/FXdiv.git

        active = true
        url = https://gitee.com/brother_even/NNPACK.git

        active = true
        url = https://gitee.com/brother_even/QNNPACK.git

        active = true
        url = https://gitee.com/mirrors/google-benchmark.git

        active = true
        url = https://gitee.com/brother_even/cpuinfo.git

        active = true
        url = https://gitee.com/brother_even/cub.git

        active = true
        url = https://gitee.com/yy126/eigen.git

        active = true
        url = https://gitee.com/brother_even/FBGEMM.git

        active = true
        url = https://gitee.com/brother_even/foxi.git

        active = true
        url = https://gitee.com/brother_even/gemmlowp.git

        active = true
        url = https://gitee.com/brother_even/gloo.git

        active = true
        url = https://gitee.com/qianjoe/google-googletest.git

        active = true
        url = https://gitee.com/brother_even/ideep.git

        active = true
        url = https://gitee.com/brother_even/ios-cmake.git

        active = true
        url = https://gitee.com/marenan/nccl.git

        active = true
        url = https://gitee.com/xizhou748/ARM_NEON_2_x86_SSE.git

        active = true
        url = https://gitee.com/qianjoe/onnx-onnx.git

        active = true
        url = https://gitee.com/verigle/onnx-tensorrt.git

        active = true
        url = https://gitee.com/zeekim/protobuf.git

        active = true
        url = https://gitee.com/brother_even/psimd.git

        active = true
        url = https://gitee.com/brother_even/pthreadpool.git

        active = true
        url = https://gitee.com/brt2/pybind11.git

        active = true
        url = https://gitee.com/brother_even/enum34.git

        active = true
        url = https://gitee.com/mirrors/peachpy.git

        active = true
        url = https://gitee.com/mirrors/Python-Six.git

        active = true
        url = https://github.com/zdevito/sleef.git

        active = true
        url = https://gitee.com/mirrors/tbb.git

        active = true
        url = https://gitee.com/swinghu/zstd.git
</code></pre>
<p>修改完后再下载所有的子模块,每次修改config文件都要输入以下命令来更新子模块</p>
<pre><code>git submodule update --init --recursive
</code></pre><br><br>
来源:https://www.cnblogs.com/cc1784380709/p/14396175.html
頁: [1]
查看完整版本: gitee解决github下载速度过慢