高速下载Github代码

参考文献

git遇到的问题之“Please make sure you have the correct access rights and the repository exists.”
直击痛点:一招搞定GitHub开源项目下载加速!

步骤

  1. 首先得下载git,然后输入git clone + 你想要下载的代码仓库,如图:
    CrowdOS项目地址

如果遇到Please make sure you have the correct access rights and the repository exists.报错等信息,则参考git遇到的问题之“Please make sure you have the correct access rights and the repository exists.”解决。

  1. 接着就是高速下载Github代码的核心原理了-------利用国内的代码托管平台gitee码云作为中介。

具体操作可参考直击痛点:一招搞定GitHub开源项目下载加速!

总结来说,就是在gitee上 导入GitHub/GitLab 仓库,如图


导入GitHub仓库

输入Git仓库的URL

最后选择导入,完成。

  1. 接下来,我们可以克隆或者下载 码云上的仓库,从而间接下载GitHub上的代码仓库。

注意,在git中输入 git clone + 码云上的仓库URL 也可能会产生Please make sure you have the correct access rights and the repository exists.问题,解决方法与上述类似。

因为最终我们克隆在本地的是码云上的代码仓库,关联的是码云。所以,如果在本地对代码进行修改等其他操作,远程上传到码云上了,并非是GitHub。所以,如果想要重新远程上传到码云上,则需要修改该仓库中.git文件夹下的config文件,如图

把url中的git@gitee 换成 git@github

  1. 在本地对仓库进行修改。完成操作后,可以通过git commit 提交,git push 推送到远程GitHub仓库。当然前提是你把原先的仓库fork下来了。

此处插入一个关于GitHub中watch、star、fork的区别认知,我也经常傻傻分不清楚。

猜你喜欢

转载自blog.csdn.net/m0_37828989/article/details/107177119