参考官方链接 tuna 谷歌
下载repo
curl https://mirrors.tuna.tsinghua.edu.cn/git/git-repo -o repo
chmod +x repo
修改repo更新源
export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo'
安装配置git
ubuntu12.04直接通过官方源安装的git版本过低,在执行repo init
会报错
The remote end hung up unexpectedly
这里要更新git的版本
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
然后配置git
git config --global user.name "Your Name"
git config --global user.email "you@example.com"
下载代码
创建工作目录
mkdir android
cd android
初始化仓库
repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest -b android-4.0.1_r1
同步源码树
repo sync
如果repo sync
过程中出现fatal error,则重复执行repo sync
,直到没有出错即可。