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.
1. git checkout Here, the idea is to clone a repository using the git-clonecommand and then check out the specific tag using git-checkout. # clone the remote repository $ git clone <repository> . # switch to the specific tag
While you can clone repositories with the git clone command, keep in mind that this clones the branch and the remote HEAD. This is usually master by default and includes all other branches in the repository.
When you clone a repository, all the tags associated with the repository will be pulled down. To fetch all the remote tags, use the fetch command as shown below. You can list down all the tags from the git repository using the following command. You can also search for tags with patterns.
There is no direct way to clone directly using the commit ID. But you can clone from a git tag. However, you can do the following workaround to perform a clone if it is really necessary.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With