Repo command reference

来源:互联网 发布:js click与onclick 编辑:程序博客网 时间:2024/06/09 13:47


IN THIS DOCUMENT

  1. init
  2. sync
  3. upload
  4. diff
  5. download
  6. forall
  7. prune
  8. start
  9. status

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 athttps://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 thePassword 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 ] 35f2596c Refactor 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

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.

lettermeaningdescription-no changesame in HEAD and indexAaddednot in HEAD, in indexMmodifiedin HEAD, modified in indexDdeletedin HEAD, not in indexRrenamednot in HEAD, path changed in indexCcopiednot in HEAD, copied from another in indexTmode changedsame content in HEAD and index, mode changedUunmergedconflict between HEAD and index; resolution required

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

lettermeaningdescription-new/unknownnot in index, in work treemmodifiedin index, in work tree, modifiedddeletedin index, not in work tree
0 0
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 5月宝宝有点斜颈偏向左侧怎么办 外斜术后变周期性内斜怎么办 右腰劳损休息一个多月还痛怎么办 宝宝鼻子不通气用嘴呼吸怎么办 窦性心律过速怎么办st-t改变 跑步机跑带上撒油跑起来滑怎么办 娃儿上嘴唇里面破了怎么办图片 支付宝添加好友点忽略了怎么办 如果综合评价考了两间大学怎么办 国二报名时民族错了怎么办 屁股凹陷下去一块已经萎缩了怎么办 我家孩子上高中了英语不好怎么办 驼背脖子向前倾怎么办用背背佳 屁股大又肥是骨盆前倾怎么办 手术40多天引起小腿变细了怎么办 老师教育学生学生跑出教室你怎么办 有矛盾舍友发朋友圈攻击我怎么办 飞机杯送的润滑油很快用完了怎么办 人笨记性不好内向反应迟钝该怎么办 洗衣机滋生了大量的霉菌在怎么办? 爸妈给兄弟买的房子贵很多怎么办 输了十几万 不敢跟爸妈讲怎么办 赌博欠2万不敢和爸妈讲怎么办 学校凳子坏了丢了 现在要查怎么办 我想写字可就是写的不好看怎么办 我的字写的很丑怎么办 大母指腱鞘炎好了之后又犯了怎么办 被蚊子咬了好大一个包怎么办 欠我钱的人跑了怎么办 下面旁边破了沙的疼怎么办 协助民警执法时质疑辅警身份怎么办 跑步每次腿落地小腿骨头疼怎么办 两年义务兵完了想继续当兵怎么办 保研联系老师说名额已满怎么办 在部队报函授不发毕业证怎么办 济南自考信息修改后原成绩怎么办 自考本科档案一直在自己手里怎么办 想考警校可身高差两公分怎么办 没读完初中现在想继续夜大怎么办 美国签证确认页姓和名写错了怎么办 单位不承认非法辞退说我旷工怎么办