repo

1.下載repo

sudo snap install git git-repo    
mkdir   ~/temp
cd  ~/temp

google

curl http://gerrit.googlesource.com/git-repo/repo > ~/temp/repo

國(guó)內(nèi)

curl [https://mirrors.tuna.tsinghua.edu.cn/git/git-repo](https://mirrors.tuna.tsinghua.edu.cn/git/git-repo) -o repo

curl "http://php.webtutor.pl/en/wp-content/uploads/2011/09/repo" > ~/temp/repo
chmod a+x ~/bin/repo

2.環(huán)境變量
臨時(shí)

PATH=~/temp:$PATH

永久 如添加.zshrc

export PATH=~/temp:$PATH
export REPO_URL='https://mirrors.tuna.tsinghua.edu.cn/git/git-repo/'

這里的repo只是一個(gè)引導(dǎo)腳本而不是直接稱之為repo,因?yàn)閞epo大部分功能代碼都不在其中,下載的只是幫助整個(gè)repo程序繼續(xù)下載和加載的工具。

初始化:
Android官方

repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-12.0.0_r16

或私有倉(cāng)庫(kù)

repo init -u ssh://xxxx@192.168.0.241:29418/xxx/manifest -b default

同步

repo sync 

--------------------------------------------抄大佬的腳本-------------------------------------------------------------
Ubuntu 18.0.4

### Step 4. install AOSP

# install repo
sudo apt install repo

# repo init (just a try, then would occur the problem concerning with python2)
VERSION="android-11.0.0_r1"
repo init -u https://android.googlesource.com/platform/manifest -b $VERSION

# change default python from 2 to 3 (don't run this before first repo init, otherwise causing another problem)
sudo sed -i '1s/python/python3/' /usr/bin/repo

# repo init again
repo init -u https://android.googlesource.com/platform/manifest -b $VERSION

# !IMPRTANT: set the mirror into chinese, otherwise would cost a lot of net flow
# there are two mirrors recommended, one is from TUNA: `https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/` and another is BFSU: `https://mirrors.bfsu.edu.cn/git/AOSP/`
AOSP_MIRROR="https://mirrors.bfsu.edu.cn/git/AOSP/"
git config --global url.${AOSP_MIRROR}.insteadof https://android.googlesource.com

# repo sync 
repo sync -j32


最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容