repo使用

repo常用指令:

1.repo init(下载repo并克隆manifest)

repo init -u URL [OPTIONS]

Options:

-u:制定一个URL,其连接到一个manifest仓库

-m:在manifest仓库中选择一个xml文件

-b:选择一个manifest仓库中的一个特殊的分支

命令repo init 要完成如下操作:

1.完成repo工具的完整下载,执行的repo脚本只是引导程序。

2.克隆清单库manifest.git (地址来自于-u 参数)

3.克隆的清单库位于manifest.git中,克隆到本地.repo/manifests.清单.repo/manifest.xml只是符号链接,它指向.repo/manifests/default.xml

4.如果manifests中有多个xml文件,repo init 可以任意选择其中一个,默认选择是default.xml

repo  init  -u git://172.16.1.31/manifest.git –m android.xml

选择的是android.xml里面的配置,.repo/manifest.xml便指向.repo/manifests/android.xml。

2.repo sync(下载code)

repo sync [<project>...]

用于参照清单文件.repo/manifest.xml克隆并同步版本库。如果某个项目版本库尚不存在,则执行repo sync 命令相当于执行git clone,如果项目版本库已经存在,则相当于执行下面的两条指令:

(1)git remote update   //相当于对每一个remote源执行fetch操作

(2)git rebase origin/branch   //针对当前分支的跟踪分支执行rebase操作。

例子

repo sync

也可以选择克隆其中一个项目

repo sync platform/build
原文地址:https://www.cnblogs.com/Caden-liu8888/p/8146966.html