1:下载android主线分支
repo init -uhttps://android.googlesource.com/platform/manifest
执行repo sync命令时出错:
fatal: The remote end hung up unexpectedly
修改方法:把.repo/manifest.xml文件中的fetch属性修改为:
http://android.googlesource.com
2:下载android其它分支
repo init -uhttps://android.googlesource.com/platform/manifest -b android-4.0.1_r1
android-4.2.2_r1
3;查看android分支版本号
git --git-dir.repo/manifests/.git/ branch -a
4:查看android当前版本号
在build/core/version_defaults.mk文件中查看PLATFORM_VERSION即可。
5:切换android分支
4.1 初始化repo客户端到某一分支(以android-4.0.3_r1为例)
repo init -bandroid-4.0.3_r1
可以在目录 .repo/manifest.xml中查看repo客户端是在哪个分支上。
4.1 同步代码
repo sync
6:创建自己的本地分支
6.1 构造本地分支
repo start myandroid4.0.3 --all ,分支名称为myandroid4.0.3
6.2检出到自己创建的分支上
repo checkout myandroid4.0.3 或
repo checkout myandroid4.0.3 origin/android-4.0.3_r1
7:下载android linux kernel代码
查看https://android.googlesource.com/
8:如何获得指定版本的Linux内核
在下载目录下执行:
git checkout remotes/origin/android-2.6.29
(以android-2.6.29为例)
repo工具是git工具的封装,下载单个project时使用git,下载所有android源码时使用repo工具。用法都是一样的。