AOSP Repo Command Reference

About Repo

Repo is a tool developed by Google to manage Android version libraries. Repo encapsulates git in Python, not to replace GIT. It simplifies the management of multiple git version libraries. All version libraries managed with repo need to use git command for operation.

Repo can integrate multiple Git code bases when necessary, upload relevant contents to Gerrit revision control system, and automatically execute some links of Android development workflow.

The repo launcher provides a Python script that can initialize checkout and download the second part, the complete repo tool. The complete repo tool is included in the Android source code checkout. The tool is located in $SRCDIR/.repo/repo /... By default. It can receive forwarded commands from the downloaded repo initiator. Repo uses the manifest file to summarize Git projects into Android super projects.

Repo command

server@dev: $ repo help
usage: repo COMMAND [ARGS]
The most commonly used repo commands are:
  abandon        Permanently abandon a development branch
  branch         View current topic branches
  branches       View current topic branches
  checkout       Checkout a branch for development
  cherry-pick    Cherry-pick a change.
  diff           Show changes between commit and working tree
  diffmanifests  Manifest diff utility
  download       Download and checkout a change
  gitc-delete    Delete a GITC Client.
  gitc-init      Initialize a GITC Client.
  grep           Print lines matching a pattern
  info           Get info on the manifest branch, current branch or unmerged branches
  init           Initialize a repo client checkout in the current directory
  list           List projects and their associated directories
  overview       Display overview of unmerged project branches
  prune          Prune (delete) already merged topics
  rebase         Rebase local branches on upstream branch
  smartsync      Update working tree to the latest known good revision
  stage          Stage file(s) for commit
  start          Start a new branch for development
  status         Show the working tree status
  sync           Update working tree to the latest revision
  upload         Upload changes for code review
See 'repo help <command>' for more information on a specific command.
See 'repo help --all' for a complete list of recognized commands.
Bug reports:
# Initialize a new client
repo init	
-u: Specifies the web address from which to retrieve the manifest code base.
-m: Select the manifest file in the code base.
-b: Specify a revision, that is, a specific manifest-branch. 
eg:repo init -u

# Synchronize clients to the code base
repo sync	

# Create a new branch
repo start	

# Delete unused local branches
repo abandon

# Delete merged branches
repo prune

# Switch branch
repo checkout

# Displays the status of the current branch
repo status	

# View modifications
repo diff 

# Upload changes to the audit server
repo upload	

# Displays the contents of the manifest file
repo manifest

repo init installs repo in the current directory, which creates a. Repo / directory containing the Git code base for repo source code and standard Android manifest files. The. Repo / directory also contains manifest.xml, a symbolic link to the selected manifest in the. repo/manifests / directory. For instructions on updating the manifest, see

Manifest files are organized in xml format. A manifest library can contain multiple manifest files and multiple branches, and each manifest file and branch has a corresponding version.

  • Remote element: defines a remote version library named korg. The base address of the library is git://
  • Project element: used to define a project. The path attribute indicates the location of the clone in the workspace, and the name attribute indicates the relative path of the remote version Library of the project.
  • Default element: set the default remote version Library of each project as Korg, and the default branch as gingerbread exdroid stable. Each project can also define its own remote and revision to override the default configuration.
  • The sub element copyfile under the project element defines an attachment action after the project clone, copying the file from src to dest

There are manifest, project, repo folder and other information in the. Repo directory

  • manifest: see which branch a module is currently in
  • project:
  • repo: View Python encapsulated scripts

Relevant reference

Tags: Android git repo

Posted on Sun, 31 Oct 2021 15:41:32 -0400 by zyntax