众所周知,因为一些原因,git clone GitHub上的kernel非常慢。除非挂梯子。

可以用一下的办法,先从镜像源中clone kernel,然后再
通过 git remode add name url 命令把原来我们要下载的仓库作为远程仓库添加到本地仓库。在执行
通过 git fetch name 命令抓取远程仓库。


1.从清华的 Tuna Mirror下clone
git clone https://mirrors.tuna.tsinghua.edu.cn/git/linux.git

在这里插入图片描述

2.通过 git branch-ar 这个命令,我们可以看到,这个代码仓库有一个 master 分支,并没有各个发布的 stable 版本。

在这里插入图片描述

3.通过 git remode add name url 命令把原来我们要下载的仓库作为远程仓库添加到本地仓库
git remote add upkernel https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

kernel的地址:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
Clone
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
https://kernel.googlesource.com/pub/scm/linux/kernel/git/stable/linux.git

4.通过 git fetch name 命令抓取远程仓库

 git fetch upkernel
Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐