1. download repo
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
Or
curl https://storage-googleapis.lug.ustc.edu.cn/git-repo-downloads/repo > ~/bin/repo
2. edit ~/bin/repo
set: REPO_URL = ‘http://mirrors.ustc.edu.cn/aosp/git-repo.git’
Or
REPO_URL = ‘git://codeaurora.org/tools/repo.git’
3. repo init
~/bin/repo init -u git://github.com/CyanogenMod/android.git -b cm-14.1
4. edit .repo/manifest.xml, set as this:
<remote name="aosp"
fetch="git://mirrors.ustc.edu.cn/aosp/"
review="android-review.googlesource.com"
revision="refs/tags/android-7.1.0_r7" />
5. repo sync
~/bin/repo sync
Or edit mysync.sh
echo “======start repo sync======”
repo sync
while [ $? == 1 ]; do
echo “======sync failed, re-sync again======”
sleep 3
repo sync
done