Skip to content
Android repo tool enhanced with a new "repo push" command, and repository actions always ordered the same as in the manifest.
Python Shell
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs Adding include element into the top-level element May 27, 2017
hooks pre-auto-gc: Add support for Windows May 3, 2017
subcmds Refactor Push() from ReviewForUpload() in project.py Sep 11, 2017
tests Fix gitc-init behavior Oct 7, 2015
.flake8 Replace pylint with pyflakes/flake8 Sep 14, 2016
.gitattributes Adds additional crlf clobber avoidance. Jun 22, 2016
.gitignore Add `repoc` to the .gitignore file Mar 8, 2013
.mailmap Update .mailmap May 26, 2017
.project Set correct name in PyDev and Eclipse project config Apr 19, 2013
.pydevproject Set correct name in PyDev and Eclipse project config Apr 19, 2013
COPYING Initial Contribution Oct 21, 2008
README.md Refactor Push() from ReviewForUpload() in project.py Sep 11, 2017
SUBMITTING_PATCHES.md Replace pylint with pyflakes/flake8 Sep 14, 2016
color.py Pylint and PEP8 fixes for color.py Mar 28, 2015
command.py Do not sort; maintain the manifest <project> order Sep 11, 2017
editor.py Allow quotes in editor command on Windows Aug 31, 2017
error.py error: fix typos Jun 4, 2015
event_log.py sync: Add support to dump a JSON event log of all sync events. May 29, 2017
git_command.py Correct command help and command options for 'repo push'. Sep 10, 2017
git_config.py Replace all os.remove calls Aug 31, 2017
git_refs.py Handle Windows line endings when reading binary files Aug 31, 2017
git_ssh Don't allow git fetch to start ControlMaster Oct 29, 2010
gitc_utils.py gitc: Lower concurrent ls-projects requests Aug 23, 2016
main.py Support pager on Windows Aug 31, 2017
manifest_xml.py Change project, path, remote in OrderedDicts Sep 7, 2017
pager.py Support pager on Windows Aug 31, 2017
platform_utils.py Replace all os.remove calls Aug 31, 2017
platform_utils_win32.py Implement islink, readlink and realpath using Win32 api Aug 31, 2017
progress.py Always print percentage when syncing quietly Jul 15, 2017
project.py Refactor Push() from ReviewForUpload() in project.py Sep 11, 2017
pyversion.py Move Python version checking to a separate module May 23, 2013
repo Correct git-repo URL Sep 11, 2017
trace.py Change print statements to work in python3 Nov 14, 2012
wrapper.py Add wrapper module Jan 30, 2014

README.md

STATUS: This seems to be functionally complete--alpha quality.

Repo is a repository management tool that Google built on top of Git. This fork provides a new repo push command.

As part of the Android development environment, Repo unifies the many Git repositories when necessary, does the uploads to the revision control system, and automates parts of the Android development workflow. Repo does not replace Git, it just makes it easier to work with Git in the context of multiple repositories. The repo command is an executable Python script that you can put anywhere in your path. In working with the Android source files, you will use Repo for across-network operations. For example, with a single repo command you can pull files from multiple repositories into your local working copy.

This fork was enhanced to add:

  1. A repo push command that performs an ordinary push of the topic branch on all repositories. This allows you to push the topic branches to GitHub or GitLab, where you can create a pull request or merge request and get your code reviewed. The existing repo upload command continues to upload to Gerrit as usual.
  2. All operations are executed in the same order as defined in the manifest file. In particular, repo push and repo upload push to the repositories in the same order that the <project> elements appear in the manifest file.

Installing and using repo

Prerequisites

repo requires Python 2.7 or above. For Python 2.6 (untested), you must install the ordereddict package before using repo.

Installation

To install repo, follow the repo installation instructions. Of course substiture this GitHub repository for the Google repository as required.

Usage

The Android Developing page shows you how to use repo. If you want do an ordinary push, use repo push command in place of repo upload. If you wish to upload to Gerrit, use repo upload as instructed.

The manifest file reference explains the contents of the manifest file that you use to describe your repositories.

There is also a handy repo Command Reference. This does not include repo push documentation, but this command will print it:

repo help push

Developer information

The rest of this page is interesting only to developers, not users.

Repository history

repo has a long history that makes it difficult to discover the canonical repository.

This repository is a fork of Google's https://gerrit.googlesource.com/git-repo/. It appears that the same code is also served as https://android.googlesource.com/tools/repo/. These two repository names have given rise to duplicate project names "git-repo" and "tools_repo" ("tools/repo" with '/' replaced with '_').

Due to the shutdown of Google Code, the original Google Code repo project https://code.google.com/p/git-repo/ has been archived for quite a while now, and is out of date.

Resyncing with official google repo

This procedure comes to us from the esrlabs/git-repo project.

For resyncing with the official google repo git, here are the commands for resyncing with the tag v1.12.33 of the official google repo:

# add google git-repo remote with tag
git remote add googlesource https://gerrit.googlesource.com/git-repo/
git checkout v1.12.33 -b google-latest

# checkout basis for resync
git checkout google-git-repo-base -b update
git merge --allow-unrelated-histories -Xtheirs --squash google-latest
git commit -m "Update: google git-repo v1.12.33"
git rebase stable

# solve conflicts; keep portability in mind

git checkout stable
git rebase update

# cleanup
git branch -D update
git branch -D google-latest

Creating a new signed version

Prepare by creating your own GPG keys as described in the Pro Git Book Signing Your Work chapter.

Export an ASCII key:

gpg --armor --export you@example.com > public.txt

Paste this key into file repo after the other keys.

Again in file repo, Increment the second element of KEYRING_VERSION:

KEYRING_VERSION = (1, 4)

In your Git working copy of git-repo, add and commit whatever files you have changed.

Sign the commit:

git tag -s -u KEYID v0.4.16 -m "COMMENT"
git push origin stable:stable
git push origin v0.4.16
  • For KEYID, use the ID of your key. List your keys using the gpg --list-keys command.
  • Replace v0.4.16 With the actual version (note that there are two occurrences of this)
  • Replace COMMENT with something more illuminating
You can’t perform that action at this time.