The repo script is generally used to obtain the android source code using git, but the source code obtained using the repo script does not contain the kernel, so if you need to download the kernel, you must also use git to manually download the kernel...
Use the GIT clone command to download the kernel to the kernel folder.
Git clone git: // android.git.kernel.org/kernel/common.git Kernel
After the download, go to the kernel folder and view all the branches and the branches of the current source code version.
Here, we need to mention that git has two concepts: local branch and remote server branch. When cloning the entire common. Git, There is only Android-2.6.36 local branch,
Run the following command to view the local branches of the current directory:
Git Branch
On brother's computer, the source code of 32 and 35 has been downloaded, so there are three branches, with an asterisk in front of the current version of the Branch
Bing @ Bing-LAPTOP :~ /Android/kernel $ git Branch
Android 2.6.32
Android 2.6.35
* Android-2.6.36:
Then add the-R parameter to view the remote server branch Bing @ Bing-LAPTOP :~ /Android/kernel $ git branch-r origin/head-> origin/Android-2.6.36 origin/Android-2.6.35 origin/Android-2.6.36 origin/Android-2.6.37 origin/Android-2.6.38 Origin /Android-2.6.39 origin/archive/Android-2.6.25 origin/archive/Android-2.6.27 origin/archive/Android-2.6.29 origin/archive/Android-2.6.32 origin/archive/android-gldfish-2.6.29 origin/archive /Android-goldfish-2.6.27 origin/linux-bcm43xx-2.6.39 origin/linux-wl12xx-2.6.39
Use the-a parameter to display the local and remote server branches, and the remote server branch will be prefixed with "remotes /"
Bing @ Bing-LAPTOP :~ /Android/kernel $ git branch-
Android 2.6.32
Android 2.6.35
* Android-2.6.36:
Remotes/ORIGIN/head-> origin/Android-2.6.36
Remotes/ORIGIN/Android-2.6.35
Remotes/ORIGIN/Android-2.6.36
Remotes/ORIGIN/Android-2.6.37
Remotes/ORIGIN/Android-2.6.38
Remotes/ORIGIN/Android-2.6.39
Remotes/ORIGIN/archive/Android-2.6.25.
Remotes/ORIGIN/archive/Android-2.6.27.
Remotes/ORIGIN/archive/Android-2.6.29.
Remotes/ORIGIN/archive/Android-2.6.32.
Remotes/ORIGIN/archive/android-gldfish-2.6.29
Remotes/ORIGIN/archive/Android-goldfsh-2.6.27
Remotes/ORIGIN/linux-bcm43xx-2.6.39
Remotes/ORIGIN/linux-wl12xx-2.6.39
Git checkout-B "A" indicates creating a local branch named "A", and switching to this branch to switch the specified remote branch to the one you created, command syntax: git checkout-B "local branch name" "The branch you want to download" for example, I want to download the 2.6.38 kernel to my new local branch: git checkout-B Android-2.6.38 origin/Android-2.6.38, the branch structure of my local machine is Bing @ Bing-LAPTOP :~ /Android/kernel $ git branch Android-2.6.32 Android-2.6.35 Android-2.6.36 * Android-2.6.38 if you need to switch between local branches, you can use the branch command to delete git branch-D remotes/ORIGIN/Android-2.6.39 for unwanted branches. Because you only use the download function of checkout, without upload, it is relatively simple. Basically, it involves the download and management of several branches.