Repo command reference

Repo usage takes the following form:

repo COMMAND OPTIONS

Optional elements are shown in brackets [ ]. Once Repo is installed, you can get information about any command by running

repo help COMMAND

Many commands take a project list as an argument. You can specify project-list as a list of names or a list of paths to local source directories for the projects:

repo sync [PROJECT0 PROJECT1 ... PROJECTN]
repo sync [/PATH/TO/PROJECT0 .../PATH/TO/PROJECTN]

init


$ repo init -u URL [OPTIONS]

Installs Repo in the current directory. This creates a .repo/ directory that contains Git repositories for the Repo source code and the standard Android manifest files. The .repo/ directory also contains manifest.xml, which is a symlink to the selected manifest in the .repo/manifests/ directory.

Options:

  • -u: specify a URL from which to retrieve a manifest repository. The common manifest can be found at https://android.googlesource.com/platform/manifest

  • -m: select a manifest file within the repository. If no manifest name is selected, the default is default.xml.

  • -b: specify a revision, i.e., a particular manifest-branch.

Note: For all remaining Repo commands, the current working directory must either be the parent directory of .repo/ or a subdirectory of the parent directory.

sync


repo sync [PROJECT_LIST]

Downloads new changes and updates the working files in your local environment. If you run repo sync without any arguments, it will synchronize the files for all the projects.

When you run repo sync, this is what happens:

  • If the project has never been synchronized, then repo sync is equivalent to git clone. All branches in the remote repository are copied to the local project directory.

  • If the project has already been synchronized once, then repo sync is equivalent to:

    git remote update 
    git rebase origin/BRANCH

    where BRANCH is the currently checked-out branch in the local project directory. If the local branch is not tracking a branch in the remote repository, then no synchronization will occur for the project.

  • If the git rebase operation results in merge conflicts, you will need to use the normal Git commands (for example, git rebase --continue) to resolve the conflicts.

After a successful repo sync, the code in specified projects will be up to date with the code in the remote repository.

Options:

  • -d: switch specified projects back to the manifest revision. Helpful if the project is currently on a topic branch, but the manifest revision is temporarily needed.

  • -s: sync to a known good build as specified by the manifest-server element in the current manifest.

  • -f: proceed with syncing other projects even if a project fails to sync.

upload


repo upload [PROJECT_LIST]

For the specified projects, Repo compares the local branches to the remote branches updated during the last repo sync. Repo will prompt you to select one or more of the branches that have not yet been uploaded for review.

After you select one or more branches, all commits on the selected branches are transmitted to Gerrit over an HTTPS connection. You will need to configure an HTTPS password to enable upload authorization. Visit the Password Generator to generate a new username/password pair to use over HTTPS.

When Gerrit receives the object data over its server, it will turn each commit into a change so that reviewers can comment on each commit individually. To combine several "checkpoint" commits together into a single commit, use git rebase -i before you run repo upload.

If you run repo upload without any arguments, it will search all the projects for changes to upload.

To make edits to changes after they have been uploaded, you should use a tool like git rebase -i or git commit --amend to update your local commits. After your edits are complete:

  • Make sure the updated branch is the currently checked out branch.

  • Use repo upload --replace PROJECT to open the change matching editor.

  • For each commit in the series, enter the Gerrit change ID inside the brackets:

    # Replacing from branch foo 
    [3021]35f2596cRefactor part of GetUploadableBranches to lookup one specific...
    [2829] ec18b4ba Update proto client to support patch set replacments
    [3022] c99883fe Teach'repo upload --replace' how to add replacement patch se...
    # Insert change numbers in the brackets to add a new patch set.
    # To create a new change record, leave the brackets empty.

After the upload is complete the changes will have an additional Patch Set.

diff


repo diff [PROJECT_LIST]

Shows outstanding changes between commit and working tree using git diff.

download


repo download TARGET CHANGE

Downloads the specified change from the review system and makes it available in your project's local working directory.

For example, to download change 23823 into your platform/frameworks/base directory:

$ repo download platform/build 23823

A repo sync should effectively remove any commits retrieved via repo download. Or, you can check out the remote branch; e.g., git checkout m/master.

*Note: There is a slight mirroring lag between when a change is visible on the web in Gerrit and when repo download will be able to find it for all users, because of replication delays to all servers worldwide.

forall


repo forall [PROJECT_LIST]-c COMMAND

Executes the given shell command in each project. The following additional environment variables are made available by repo forall:

  • REPO_PROJECT is set to the unique name of the project.

  • REPO_PATH is the path relative to the root of the client.

  • REPO_REMOTE is the name of the remote sstem from the manifest.

  • REPO_LREV is the name of the revision from the manifest, translated to a local tracking branch. Used if you need to pass the manifest revision to a locally executed git command.

  • REPO_RREV is the name of the revision from the manifest, exactly as written in the manifest.

Options:

  • -c: command and arguments to execute. The command is evaluated through /bin/sh and any arguments after it are passed through as shell positional parameters.

  • -p: show project headers before output of the specified command. This is achieved by binding pipes to the command's stdin, stdout, and sterr streams, and piping all output into a continuous stream that is displayed in a single pager session.

  • -v: show messages the command writes to stderr.

prune


repo prune [PROJECT_LIST]

Prunes (deletes) topics that are already merged.

start


repo start BRANCH_NAME [PROJECT_LIST]

Begins a new branch for development, starting from the revision specified in the manifest.

The BRANCH_NAME argument should provide a short description of the change you are trying to make to the projects.If you don't know, consider using the name default.

The PROJECT_LIST specifies which projects will participate in this topic branch.

Note: "." is a useful shorthand for the project in the current working directory.

status


repo status [PROJECT_LIST]

Compares the working tree to the staging area (index) and the most recent commit on this branch (HEAD) in each project specified. Displays a summary line for each file where there is a difference between these three states.

To see the status for only the current branch, run repo status. The status information will be listed by project. For each file in the project, a two-letter code is used:

In the first column, an uppercase letter indicates how the staging area differs from the last committed state.

letter meaning description
- no change same in HEAD and index
A added not in HEAD, in index
M modified in HEAD, modified in index
D deleted in HEAD, not in index
R renamed not in HEAD, path changed in index
C copied not in HEAD, copied from another in index
T mode changed same content in HEAD and index, mode changed
U unmerged conflict between HEAD and index; resolution required

In the second column, a lowercase letter indicates how the working directory differs from the index.

letter meaning description
- new/unknown not in index, in work tree
m modified in index, in work tree, modified
d deleted in index, not in work tree

Repo command reference的更多相关文章

  1. Cisco IOS Debug Command Reference I through L

    debug iapp through debug ip ftp debug iapp : to begin debugging of IAPP operations(in privileged EXE ...

  2. Cisco IOS debug command reference Command A through D

    debug aaa accounting through debug auto-config debug aaa accounting : to display information on acco ...

  3. EntityFramework:EF Migrations Command Reference

    Entity Framework Migrations are handled from the package manager console in Visual Studio. The usage ...

  4. 【Linux command reference】

    ubuntu16.04安装中文输入法: https://blog.csdn.net/singleyellow/article/details/77448246 ubuntu16.04 用vi编辑代码, ...

  5. Cisco IOS Software Activation Command Reference

    clear license agent : to clear license agent statistics counters or connection statistics (in privil ...

  6. Cisco IOS basic system management command reference

    absolute : to specify an absolute time for a time-range (in time-range configuration mode) no absolu ...

  7. Cisco IOS Debug Command Reference Command E through H

    debug eap through debug he-module subslot periodic debug eap : to display information about Extensib ...

  8. Unix/Linux Command Reference

  9. repo 官方教程

    参考 http://android.git.kernel.org/repo http://source.android.com/source/downloading.html http://sourc ...

随机推荐

  1. oracle dual是个什么表

    这几天一直在研究oracle,常常会用到dual这个系统表,dual表到底是一个什么表?带着疑问查了百度了一下,现在总结一下:DUAL是Oracle与数据字典一起自动创建的一个表,它只有一列:DUMM ...

  2. CD4051的切换时间

    CD4051:1 2 4 5 12 13 14 15  8个选择IO输入/输出端:3:I/O6:片选低电平有效,搞定平所有通道不通9 10 11:地址选择:功能:通过地址选择译码8个中的某个通道与3脚 ...

  3. MDX查询语句

    另:15个经典的MDX查询语句 另:http://www.cnblogs.com/biwork/p/3437959.html 1.排名+排序+量值过滤: WITH member [Measures]. ...

  4. 安卓新的联网方式 Volley的使用(一)加载图片与 json

    最近刚接触安卓, 以前搞wp ,一对比起来 ,安卓怎么这么麻烦.联网必须要重新开一个线程才可以.而且加载网络图片也很麻烦...花了很久一直卡在快速滑动加载网络图片的listview上面 ,一直很纠结痛 ...

  5. 如何在spring环境中做单元测试

    在测试类的上方加入以下注解 @RunWith(SpringJUnit4ClassRunner.class)@ContextConfiguration("classpath:spring.xm ...

  6. JAVA本地项目手机访问

    http://192.168.40.56:7082/carloan/#newOrderView ipconfig  找到本地ip,然后把localhost改成本地ip就行

  7. github上ReadMe语法

    大标题 =================================== 大标题一般显示工程名,类似html的\<h1\><br /> 你只要在标题下面跟上=====即可 ...

  8. iOS 多尺寸屏幕适配

    Point Point可以理解为iOS程序员眼中的大小单位.它是iOS操作系统中的抽象的概念. Rendered Pixels可以理解为UI设计师眼中的大小单位. Physical Pixels 设备 ...

  9. 这么大一座Azure“图书馆”,你竟没有发现…

    为避免被叫做「伸手党」,很多技术人员早已养成遇到问题上网搜的好习惯. 然而…… 同一个概念,搜到两个相互矛盾的解释,以谁的为准? 想查找某个 API 的用法,搜索结果数十万条,怎样筛选出最有价值的? ...

  10. 使用javap深入理解Java整型常量和整型变量的区别

    我下图代码第五行和第九行分别定义了一个整型变量和一个整型常量: static final int number1 = 512; static int number3 = 545; Java程序员都知道 ...