13

I want to get linux kernel 2.6.22.19 source for cross compiling stuff for my router, but the repo is huge (3gb) if I do

git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git

and then check out that tag, the clone took forever, my bandwidth is limited.

if I run this

git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git --branch v2.6.22.19 --single-branch

the filesize recived is around 150mb, is this the correct way of doing it, what does this command likne mean ? v2.6.22.19 is a tag name right? why it can bed added after --branch ?

after cloning.

[oglop@localhost linux-stable]$ git status
# Not currently on any branch.
sashoalm
  • 75,001
  • 122
  • 434
  • 781
Shuman
  • 3,914
  • 8
  • 42
  • 65
  • Why not download one of the release tar.xz files. – MrTux Mar 13 '16 at 00:45
  • because I can not find 2.6.22.19 here? https://www.kernel.org/pub/linux/kernel/v2.6/ – Shuman Mar 13 '16 at 00:49
  • 2
    Possible duplicate of [How to git clone a specific tag](http://stackoverflow.com/questions/20280726/how-to-git-clone-a-specific-tag) – merlin2011 Mar 13 '16 at 00:53
  • 1
    @Shuman: Use `git checkout v2.6.22.19` to make it the current branch. – unutbu Mar 13 '16 at 01:02
  • @unutbu still the same. `[oglop@localhost linux-stable-kernel]$ git checkout v2.6.22.19 HEAD is now at 37579d1... Linux 2.6.22.19 [oglop@localhost linux-stable-kernel]$ git status # Not currently on any branch. ` – Shuman Mar 13 '16 at 01:24

1 Answers1

21

providing v2.6.22.19 is the tag name and git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git is the repository url, try this:

git clone --depth 1 --single-branch --branch v2.6.22.19 git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git

the --depth 1 will download only the latest commit in the branch, this will also helps with the size issues

Jiri Kremser
  • 12,471
  • 7
  • 45
  • 72