在本地创建repo镜像时对多个不同源,部分代码仓进行服用(最好来自同一厂商的)

1. 下载初始仓(该部分可参考https://mirrors.tuna.tsinghua.edu.cn/help/AOSP/镜像下载及初始化)

repo init -u https://aosp.tuna.tsinghua.edu.cn/mirror/manifest --mirror

 2. 进行同步镜像仓

repo sync

3. 同步完成后修改镜像仓进行添加其他镜像仓

cd .repo/manifests/
git remote -v
git remote rename origin bak
git remote add origin https://xxx/manifest        -->你另外的manifest仓地址
git checkout origin/manifest        --> 切换分支
git branch -m default bak            -->修改新分支为default
git checkout -b default
cd ../../
repo sync                            -->再次同步代码,在前面代码上就会根据新的manifest去同步更            新到本地中之前的代码分支也会保留,增加了新的仓中不同的代码。

这样也就能减少在本地创建镜像仓时,多份镜像仓占用空间又用不到的情况,资源重复更新重复的问题。(当然还是要有份备份,防止更新新代码时整体崩溃问题)

4.切换回之前代码更新时

cd .repo/manifests
git remote rename origin xxx
git remote rename bak origin
git checkout origin/manifest
git branch -m default xxx
git branch -m bak default

你可能感兴趣的:(工具,Android)