Repo  is a tool for using several git repositories in the same build. It features a manifest format using XML where one defines the git repositories and revisions one wants to use. It is possible to include manifests in other manifests.
Repo feature overview¶
Download several git repositories simultaneously.
Use different revisions for different repositories.
- Revisions can be branches, tags or commit hashes.
Combine manifests together.
- Create more specialized manifests from a common base.
Default settings for revision etc.
Separate remotes and actual repositories.
Using repo with yocto¶
When doing yocto builds, the repo tool is useful to have the various yocto layers synced towards the same yocto release (typically, a poky release).
Revisions in repo manifests can be branch names, tags, or commit hashes. Commit hashes are a good solution for reproducing builds, but in order to be able to follow layers as they move, branch names are preferred.
If one wants to support several yocto releases, it is possible to use different branches in the manifest repository, where the manifest in each branch would then point to the corresponding branch (or a commit on that branch) in the layers used.
Below is an example of a manifest from PELUX  showcasing the format.
<?xml version="1.0" encoding="UTF-8"?> <manifest> <!-- Settings --> <default sync-j="4" revision="pyro" /> <!-- Remotes --> <remote fetch="git://git.openembedded.org" name="oe"/> <remote fetch="git://github.com/" name="github"/> <remote fetch="git://code.qt.io/" name="code.qt"/> <!-- Base stuff --> <project remote="oe" revision="5e82995148a2844c6f483ae5ddd1438d87ea9fb7" name="meta-openembedded" path="sources/meta-openembedded"/> <project remote="github" revision="2c7899b9f71ce614a253d7875fe64e170159281a" name="Pelagicore/meta-bistro" path="sources/meta-bistro" /> <project remote="github" revision="4861f6d58042909e6c79cb301c6eb39c349011bf" name="Pelagicore/meta-pelux" path="sources/meta-pelux" /> <!-- Qt Support stuff --> <project remote="code.qt" revision="c6aa602d0640040b470ee81de39726276ddc0ea3" name="yocto/meta-qt5" path="sources/meta-qt5"/> </manifest>
path setting, which tells repo where to put the checked out git repo,
relative to the current working directory.
Using the repo tool¶
In the yocto setting, two repo commands are commonly used:
repo sync. The first sets up repo in the current
working directory, and the second downloads all the git repositories
in the selected manifest.
$ mkdir <some-directory> $ cd <some-directory> $ repo init -u <manifest repo URL> -m <manifest> -b <branch> $ repo sync
The curious reader can poke around in
.repo after running repo sync, where
one can also change what manifest being used by changing the symlink for