from:http://herbertbt.blog.163.com/blog/static/57266582201218102131173/


在网上搜了以下,都是获取某个分支的。如果哦用
  repo init -u git://Android.git.kernel.org/platform/manifest.git
取得分支,获得的是最近的正在研发的代码,而不是你想要的稳定代码。
所以我们获取稳定的代码,先要看看当前有些什么branch.

打开android 官网   http://source.android.com/source/downloading.html
 获取repo 脚本 ,
(否则可能会得到 “        在未预料的“newline”附近出现语法错误”,脚本变了)。

curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo

在你的android 目录下:
sudo git clone  https://android.googlesource.com/platform/manifest
 cd manifest
 git branch -a
   master
 remotes/origin/HEAD -> origin/master
 remotes/origin/android-1.6_r1
 remotes/origin/android-1.6_r1.1
 remotes/origin/android-1.6_r1.2
 remotes/origin/android-1.6_r1.3
 remotes/origin/android-1.6_r1.4
 remotes/origin/android-1.6_r1.5
 remotes/origin/android-1.6_r2
 remotes/origin/android-2.0.1_r1
 remotes/origin/android-2.0_r1
 remotes/origin/android-2.1_r1
 remotes/origin/android-2.1_r2
 remotes/origin/android-2.1_r2.1p
 remotes/origin/android-2.1_r2.1p2
 remotes/origin/android-2.1_r2.1s
 remotes/origin/android-2.2.1_r1
 remotes/origin/android-2.2.1_r2
 remotes/origin/android-2.2.2_r1
 remotes/origin/android-2.2.3_r1
 remotes/origin/android-2.2.3_r2
 remotes/origin/android-2.2_r1
 remotes/origin/android-2.2_r1.1
 remotes/origin/android-2.2_r1.2
 remotes/origin/android-2.2_r1.3
 remotes/origin/android-2.3.1_r1
 remotes/origin/android-2.3.2_r1
 remotes/origin/android-2.3.3_r1
 remotes/origin/android-2.3.3_r1.1
 remotes/origin/android-2.3.4_r0.9
 remotes/origin/android-2.3.4_r1
 remotes/origin/android-2.3.5_r1
 remotes/origin/android-2.3.6_r0.9
 remotes/origin/android-2.3.6_r1
 remotes/origin/android-2.3.7_r1
 remotes/origin/android-2.3_r1
 remotes/origin/android-4.0.1_r1
 remotes/origin/android-4.0.1_r1.1
 remotes/origin/android-4.0.1_r1.2
 remotes/origin/android-4.0.2_r1
 remotes/origin/android-4.0.3_r1
 remotes/origin/android-cts-2.2_r8
 remotes/origin/android-cts-2.3_r10
 remotes/origin/android-cts-2.3_r11
 remotes/origin/android-cts-4.0_r1
 remotes/origin/android-cts-verifier-4.0_r1
 remotes/origin/android-sdk-4.0.3-tools_r1
 remotes/origin/android-sdk-4.0.3_r1
 remotes/origin/android-sdk-adt_r16.0.1
 remotes/origin/froyo
 remotes/origin/gingerbread
 remotes/origin/gingerbread-release
 remotes/origin/ics-mr0
 remotes/origin/ics-mr1
 remotes/origin/master
 remotes/origin/tradefed



默认取得的是master了。

repo init -u https://android.googlesource.com/platform/manifest -b  
android-2.3.5_r1
就取到了 android-2.3.5_r1 版本