参考

  http://android.git.kernel.org/repo

  http://source.android.com/source/downloading.html

  http://source.android.com/source/version-control.html

  https://source.android.com/source/using-repo.html

  repo只是google用Python脚本写的调用Git的一个脚本,主要是用来下载、管理Android项目的软件仓库。

下载 repo

$wget http://android.git.kernel.org/rep

  或者

$curl http://android.git.kernel.org/repo >~/bin/repo 

增加执行权限

$chmod a+x ~/bin/repo 

Repo command reference

Repo usage takes the following form:

repo <COMMAND> <OPTIONS>

Optional elements are shown in brackets [ ]. For example, 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>]

help

Once Repo is installed, you can find the latest documentation starting with a summary of all commands by running:

repo help

You can get information about any command by running this within a Repo tree:

repo help <COMMAND>

For example, the following command yields a description and list of options for the init argument of Repo, which initializes Repo in the current directory. (See init for more details.)

repo help init

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.

只能在包含.repo的目录及其子目录内执行repo命令

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:

repo sync的3个参数选项: -d -s -f
  • -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.

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

    # Replacing from branch foo 
    [ 3021 ] 35f2596c Refactor part of GetUploadableBranches to lookup one specific...
    [ 2829 ] ec18b4ba Update proto client to support patch set replacments
    # 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/build directory:

$ repo download platform/build 

  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 system 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:

repo status 显示当前工程的所有信息,如两列字母显示状态变化:如下:注意其中棕色字体。
project hardware/ti/omap4-aah/ branch xxxxxx
project hardware/ti/omap4xxx/ branch xxxxxx
project kernel/ branch xxxxxx
-m drivers/base/core.c
-m drivers/soc/qcom/Kconfig
-m drivers/soc/qcom/qdsp6v2/Makefile
-m drivers/soc/qcom/qdsp6v2/adsp-loader.c
-m include/linux/kern_levels.h
-m kernel/printk.c
-m lib/dynamic_debug.c
project libcore/ branch xxxxxx
project libnativehelper/ branch xxxxxx
project ndk/ branch xxxxxx
  • 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 复位清空所有本地修改

repo forall -c 'git reset --hard HEAD;git clean -df;git rebase --abort'

repo 官方教程的更多相关文章

  1. Unity性能优化(3)-官方教程Optimizing garbage collection in Unity games翻译

    本文是Unity官方教程,性能优化系列的第三篇<Optimizing garbage collection in Unity games>的翻译. 相关文章: Unity性能优化(1)-官 ...

  2. Unity性能优化(4)-官方教程Optimizing graphics rendering in Unity games翻译

    本文是Unity官方教程,性能优化系列的第四篇<Optimizing graphics rendering in Unity games>的翻译. 相关文章: Unity性能优化(1)-官 ...

  3. Unity性能优化(2)-官方教程Diagnosing performance problems using the Profiler window翻译

    本文是Unity官方教程,性能优化系列的第二篇<Diagnosing performance problems using the Profiler window>的简单翻译. 相关文章: ...

  4. Unity性能优化(1)-官方教程The Profiler window翻译

    本文是Unity官方教程,性能优化系列的第一篇<The Profiler window>的简单翻译. 相关文章: Unity性能优化(1)-官方教程The Profiler window翻 ...

  5. jeecg表单页面控件权限设置(请先看官方教程,如果能看懂就不用看这里了)

    只是把看了官方教程后,觉得不清楚地方补充说明一下: 1. 2. 3. 4.用"jeecgDemoController.do?addorupdate"这个路径测试,不出意外现在应该可 ...

  6. [转]Google Guava官方教程(中文版)

    Google Guava官方教程(中文版) http://ifeve.com/google-guava/

  7. Google Guava官方教程(中文版)

    Google Guava官方教程(中文版) 原文链接  译文链接 译者: 沈义扬,罗立树,何一昕,武祖  校对:方腾飞 引言 Guava工程包含了若干被Google的 Java项目广泛依赖 的核心库, ...

  8. OpenGL官方教程——着色器语言概述

    OpenGL官方教程——着色器语言概述 OpenGL官方教程——着色器语言概述 可编程图形硬件管线(流水线) 可编程顶点处理器 可编程几何处理器 可编程片元处理器 语言 可编程图形硬件管线(流水线) ...

  9. [苏飞开发助手V1.0测试版]官方教程与升级报告

           [苏飞开发助手V1.0测试版]官方教程与升级报告导读部分----------------------------------------------------------------- ...

随机推荐

  1. linux第12天 线程

    今天主要学习了共享内存,信号量的封装,还有线程. POSIX线程库 与线程有关的函数构成了一个完整的系列,绝大多数函数的名字都是以“pthread_”打头的 要使用这些函数库,要通过引入头文<p ...

  2. HDU 3037 Saving Beans(Lucas定理模板题)

    Problem Description Although winter is far away, squirrels have to work day and night to save beans. ...

  3. Codeforces Round #288 (Div. 2)

    A. Pasha and Pixels     题意就是给一个n*m的矩阵,k次操作,一开始矩阵全白,一次操作可以染黑一个格子,问第几次操作可以使得矩阵中存在一个2*2的黑色矩阵.直接模拟即可 代码: ...

  4. Hibernate开始上手总结

    1,导入hibernate 的jar包,c3p0jar包 2,创建和表关联的实体类,创建关联实体类的配置文件 package com.entity; public class News { priva ...

  5. 转一篇 adaboost 的好文 AdaBoost简介及训练误差分析

    AdaBoost简介及训练误差分析 http://wenku.baidu.com/link?url=y9Q2qjrJr6IShyY5EQEmvkPZmmP4t3HOdHUgMWaIffI9W0uzTr ...

  6. Java高效编程之一【创建和销毁对象】

    一.考虑用静态工厂方法替代构造函数 代表实现:java.util.Collection Framework Boolean类的简单例子: public static Boolean valueOf ( ...

  7. HTML5 Web app开发工具Kendo UI Web中Grid网格控件的使用

    Kendo UI Web中的Grid控件不仅可以显示数据,并对数据提供了丰富的支持,包括分页.排序.分组.选择等,同时还有着大量的配置选项.使用Kendo DataSource组件,可以绑定到本地的J ...

  8. django migrate10060 Duplicate column name错误

    这个错误意思是有重复的列名,其实大部分原因是因为某些列被执行了多次,可以打开migration里面的django生成的文件去排查错误,然后自己手动修改数据库还原,实在不行可以把除了0001和init文 ...

  9. JSP:一种服务器端动态页面技术的组件规范。

    java Servlet page:java服务器端页面,会增加服务器的压力. jsp文件会被容器转换成一个Servlet类然后执行. JSP页面中的注释: HTML注释:<!-- 注释中的ja ...

  10. hadoop之Spark强有力竞争者Flink,Spark与Flink:对比与分析

    hadoop之Spark强有力竞争者Flink,Spark与Flink:对比与分析 Spark是一种快速.通用的计算集群系统,Spark提出的最主要抽象概念是弹性分布式数据集(RDD),它是一个元素集 ...