参考文档:
http://yinger-fei.iteye.com/blog/1300144
http://blog.youkuaiyun.com/ruanjianxiong/article/details/7610299
$ mkdir ~/bin
$ PATH=~/bin:$PATH
$ sudo apt-get install git-core curl //安装git curl
$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY
$ git config --global user.name "Your Name"
$ git config --global user.email "you@example.com"
$ repo init -u https://android.googlesource.com/platform/manifest
$ repo init -u https://android.googlesource.com/platform/manifest -b android-cts-5.0_r5
$ repo sync
android源码编译时要求git版本不低于1.7.2,采用下面这个方式来升级git:
1:sudo add-apt-repository ppa:git-core/ppa
2:sudo apt-get update
3:sudo apt-get install git-core curl
source code: