blob: 1eead91deebb7b79e4744667442622bb6051db1d [file] [log] [blame] [view]
Mike Frysingerb8f7bb02018-10-10 01:05:11 -04001# repo Manifest Format
Shawn O. Pearce3e548192008-11-04 11:19:36 -08002
3A repo manifest describes the structure of a repo client; that is
4the directories that are visible and where they should be obtained
5from with git.
6
7The basic structure of a manifest is a bare Git repository holding
Mike Frysinger3891b752018-10-05 19:26:15 -04008a single `default.xml` XML file in the top level directory.
Shawn O. Pearce3e548192008-11-04 11:19:36 -08009
10Manifests are inherently version controlled, since they are kept
11within a Git repository. Updates to manifests are automatically
12obtained by clients during `repo sync`.
13
Mike Frysinger3891b752018-10-05 19:26:15 -040014[TOC]
15
Shawn O. Pearce3e548192008-11-04 11:19:36 -080016
Mike Frysingerb8f7bb02018-10-10 01:05:11 -040017## XML File Format
Shawn O. Pearce3e548192008-11-04 11:19:36 -080018
Mike Frysinger3891b752018-10-05 19:26:15 -040019A manifest XML file (e.g. `default.xml`) roughly conforms to the
Shawn O. Pearce3e548192008-11-04 11:19:36 -080020following DTD:
21
Mike Frysinger3891b752018-10-05 19:26:15 -040022```xml
23<!DOCTYPE manifest [
Mike Frysinger0888a082021-04-13 20:22:01 -040024
Mike Frysinger3891b752018-10-05 19:26:15 -040025 <!ELEMENT manifest (notice?,
26 remote*,
27 default?,
28 manifest-server?,
LaMont Jonescc879a92021-11-18 22:40:18 +000029 submanifest*?,
Mike Frysinger3891b752018-10-05 19:26:15 -040030 remove-project*,
31 project*,
32 extend-project*,
33 repo-hooks?,
Raman Tenneti1bb4fb22021-01-07 16:50:45 -080034 superproject?,
Raman Tenneti1c3f57e2021-05-04 12:32:13 -070035 contactinfo?,
Mike Frysinger3891b752018-10-05 19:26:15 -040036 include*)>
Chirayu Desaid5a5b192013-11-21 19:15:30 +053037
Mike Frysinger3891b752018-10-05 19:26:15 -040038 <!ELEMENT notice (#PCDATA)>
Chirayu Desaid5a5b192013-11-21 19:15:30 +053039
Jack Neus6ea0cae2021-07-20 20:52:33 +000040 <!ELEMENT remote (annotation*)>
Mike Frysinger3891b752018-10-05 19:26:15 -040041 <!ATTLIST remote name ID #REQUIRED>
42 <!ATTLIST remote alias CDATA #IMPLIED>
43 <!ATTLIST remote fetch CDATA #REQUIRED>
44 <!ATTLIST remote pushurl CDATA #IMPLIED>
45 <!ATTLIST remote review CDATA #IMPLIED>
46 <!ATTLIST remote revision CDATA #IMPLIED>
Chirayu Desaid5a5b192013-11-21 19:15:30 +053047
Mike Frysinger3891b752018-10-05 19:26:15 -040048 <!ELEMENT default EMPTY>
49 <!ATTLIST default remote IDREF #IMPLIED>
50 <!ATTLIST default revision CDATA #IMPLIED>
51 <!ATTLIST default dest-branch CDATA #IMPLIED>
52 <!ATTLIST default upstream CDATA #IMPLIED>
53 <!ATTLIST default sync-j CDATA #IMPLIED>
54 <!ATTLIST default sync-c CDATA #IMPLIED>
55 <!ATTLIST default sync-s CDATA #IMPLIED>
56 <!ATTLIST default sync-tags CDATA #IMPLIED>
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -070057
Mike Frysinger3891b752018-10-05 19:26:15 -040058 <!ELEMENT manifest-server EMPTY>
59 <!ATTLIST manifest-server url CDATA #REQUIRED>
Chirayu Desaid5a5b192013-11-21 19:15:30 +053060
LaMont Jonescc879a92021-11-18 22:40:18 +000061 <!ELEMENT submanifest EMPTY>
Mike Frysinger08964a12025-12-02 10:52:29 -050062 <!ATTLIST submanifest name ID #REQUIRED>
LaMont Jonescc879a92021-11-18 22:40:18 +000063 <!ATTLIST submanifest remote IDREF #IMPLIED>
64 <!ATTLIST submanifest project CDATA #IMPLIED>
65 <!ATTLIST submanifest manifest-name CDATA #IMPLIED>
66 <!ATTLIST submanifest revision CDATA #IMPLIED>
67 <!ATTLIST submanifest path CDATA #IMPLIED>
68 <!ATTLIST submanifest groups CDATA #IMPLIED>
LaMont Jones501733c2022-04-20 16:42:32 +000069 <!ATTLIST submanifest default-groups CDATA #IMPLIED>
LaMont Jonescc879a92021-11-18 22:40:18 +000070
Mike Frysinger3891b752018-10-05 19:26:15 -040071 <!ELEMENT project (annotation*,
72 project*,
73 copyfile*,
74 linkfile*)>
75 <!ATTLIST project name CDATA #REQUIRED>
76 <!ATTLIST project path CDATA #IMPLIED>
77 <!ATTLIST project remote IDREF #IMPLIED>
78 <!ATTLIST project revision CDATA #IMPLIED>
79 <!ATTLIST project dest-branch CDATA #IMPLIED>
80 <!ATTLIST project groups CDATA #IMPLIED>
81 <!ATTLIST project sync-c CDATA #IMPLIED>
82 <!ATTLIST project sync-s CDATA #IMPLIED>
Kyunam Jo01019d92019-03-18 13:30:58 +090083 <!ATTLIST project sync-tags CDATA #IMPLIED>
Mike Frysinger08964a12025-12-02 10:52:29 -050084 <!ATTLIST project upstream CDATA #IMPLIED>
Mike Frysinger3891b752018-10-05 19:26:15 -040085 <!ATTLIST project clone-depth CDATA #IMPLIED>
Mike Frysinger08964a12025-12-02 10:52:29 -050086 <!ATTLIST project force-path CDATA #IMPLIED>
James W. Mills24c13082012-04-12 15:04:13 -050087
Mike Frysinger3891b752018-10-05 19:26:15 -040088 <!ELEMENT annotation EMPTY>
89 <!ATTLIST annotation name CDATA #REQUIRED>
90 <!ATTLIST annotation value CDATA #REQUIRED>
91 <!ATTLIST annotation keep CDATA "true">
Chirayu Desaid5a5b192013-11-21 19:15:30 +053092
Mike Frysinger3891b752018-10-05 19:26:15 -040093 <!ELEMENT copyfile EMPTY>
94 <!ATTLIST copyfile src CDATA #REQUIRED>
95 <!ATTLIST copyfile dest CDATA #REQUIRED>
Ruslan Bilovol54527e72015-09-08 13:11:23 +030096
Mike Frysinger3891b752018-10-05 19:26:15 -040097 <!ELEMENT linkfile EMPTY>
Mike Frysinger08964a12025-12-02 10:52:29 -050098 <!ATTLIST linkfile src CDATA #REQUIRED>
Mike Frysinger3891b752018-10-05 19:26:15 -040099 <!ATTLIST linkfile dest CDATA #REQUIRED>
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300100
Peter Kjellerstedt4ab22842025-10-16 20:29:28 +0200101 <!ELEMENT extend-project (annotation*,
102 copyfile*,
103 linkfile*)>
Mike Frysinger08964a12025-12-02 10:52:29 -0500104 <!ATTLIST extend-project name CDATA #REQUIRED>
105 <!ATTLIST extend-project path CDATA #IMPLIED>
106 <!ATTLIST extend-project dest-path CDATA #IMPLIED>
107 <!ATTLIST extend-project groups CDATA #IMPLIED>
108 <!ATTLIST extend-project revision CDATA #IMPLIED>
109 <!ATTLIST extend-project remote CDATA #IMPLIED>
Erik Elmeke4cdfdb72022-09-09 17:13:17 +0200110 <!ATTLIST extend-project dest-branch CDATA #IMPLIED>
Mike Frysinger08964a12025-12-02 10:52:29 -0500111 <!ATTLIST extend-project upstream CDATA #IMPLIED>
112 <!ATTLIST extend-project base-rev CDATA #IMPLIED>
Josh Triplett884a3872014-06-12 14:57:29 -0700113
Mike Frysinger3891b752018-10-05 19:26:15 -0400114 <!ELEMENT remove-project EMPTY>
Fredrik de Grootbe71c2f2023-05-31 16:56:34 +0200115 <!ATTLIST remove-project name CDATA #IMPLIED>
116 <!ATTLIST remove-project path CDATA #IMPLIED>
117 <!ATTLIST remove-project optional CDATA #IMPLIED>
Fredrik de Groot303bd962024-09-09 15:54:57 +0200118 <!ATTLIST remove-project base-rev CDATA #IMPLIED>
Doug Anderson37282b42011-03-04 11:54:18 -0800119
Mike Frysinger3891b752018-10-05 19:26:15 -0400120 <!ELEMENT repo-hooks EMPTY>
Mike Frysinger08964a12025-12-02 10:52:29 -0500121 <!ATTLIST repo-hooks in-project CDATA #REQUIRED>
Mike Frysinger3891b752018-10-05 19:26:15 -0400122 <!ATTLIST repo-hooks enabled-list CDATA #REQUIRED>
Brian Harring26448742011-04-28 05:04:41 -0700123
Raman Tenneti1c3f57e2021-05-04 12:32:13 -0700124 <!ELEMENT superproject EMPTY>
Xin Lie0b16a22021-09-26 23:20:32 -0700125 <!ATTLIST superproject name CDATA #REQUIRED>
126 <!ATTLIST superproject remote IDREF #IMPLIED>
127 <!ATTLIST superproject revision CDATA #IMPLIED>
Raman Tenneti1bb4fb22021-01-07 16:50:45 -0800128
Raman Tenneti1c3f57e2021-05-04 12:32:13 -0700129 <!ELEMENT contactinfo EMPTY>
Mike Frysinger08964a12025-12-02 10:52:29 -0500130 <!ATTLIST contactinfo bugurl CDATA #REQUIRED>
Raman Tenneti1c3f57e2021-05-04 12:32:13 -0700131
Mike Frysinger3891b752018-10-05 19:26:15 -0400132 <!ELEMENT include EMPTY>
Shuchuan Zeng3e3340d2023-04-18 10:36:50 +0800133 <!ATTLIST include name CDATA #REQUIRED>
134 <!ATTLIST include groups CDATA #IMPLIED>
135 <!ATTLIST include revision CDATA #IMPLIED>
Mike Frysinger3891b752018-10-05 19:26:15 -0400136]>
137```
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800138
Raman Tenneti48b2d102021-01-11 12:18:47 -0800139For compatibility purposes across repo releases, all unknown elements are
140silently ignored. However, repo reserves all possible names for itself for
141future use. If you want to use custom elements, the `x-*` namespace is
142reserved for that purpose, and repo guarantees to never allocate any
143corresponding names.
144
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800145A description of the elements and their attributes follows.
146
147
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400148### Element manifest
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800149
150The root element of the file.
151
Mike Frysinger51e39d52020-12-04 05:32:06 -0500152### Element notice
153
154Arbitrary text that is displayed to users whenever `repo sync` finishes.
155The content is simply passed through as it exists in the manifest.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800156
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400157### Element remote
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800158
159One or more remote elements may be specified. Each remote element
160specifies a Git URL shared by one or more projects and (optionally)
161the Gerrit review server those projects upload changes through.
162
163Attribute `name`: A short name unique to this manifest file. The
164name specified here is used as the remote name in each project's
165.git/config, and is therefore automatically available to commands
166like `git fetch`, `git remote`, `git pull` and `git push`.
167
Yestin Sunb292b982012-07-02 07:32:50 -0700168Attribute `alias`: The alias, if specified, is used to override
169`name` to be set as the remote name in each project's .git/config.
170Its value can be duplicated while attribute `name` has to be unique
171in the manifest file. This helps each project to be able to have
172same remote name which actually points to different remote url.
173
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800174Attribute `fetch`: The Git URL prefix for all projects which use
175this remote. Each project's name is appended to this prefix to
176form the actual URL used to clone the project.
177
Steve Raed6480452016-08-10 15:00:00 -0700178Attribute `pushurl`: The Git "push" URL prefix for all projects
179which use this remote. Each project's name is appended to this
180prefix to form the actual URL used to "git push" the project.
181This attribute is optional; if not specified then "git push"
182will use the same URL as the `fetch` attribute.
183
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800184Attribute `review`: Hostname of the Gerrit server where reviews
185are uploaded to by `repo upload`. This attribute is optional;
186if not specified then `repo upload` will not function.
187
Mike Frysinger6e89c962020-11-15 18:42:26 -0500188Attribute `revision`: Name of a Git branch (e.g. `main` or
189`refs/heads/main`). Remotes with their own revision will override
Anthony King36ea2fb2014-05-06 11:54:01 +0100190the default revision.
191
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400192### Element default
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800193
194At most one default element may be specified. Its remote and
195revision attributes are used when a project element does not
196specify its own remote or revision attribute.
197
198Attribute `remote`: Name of a previously defined remote element.
199Project elements lacking a remote attribute of their own will use
200this remote.
201
Mike Frysinger6e89c962020-11-15 18:42:26 -0500202Attribute `revision`: Name of a Git branch (e.g. `main` or
203`refs/heads/main`). Project elements lacking their own
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800204revision attribute will use this revision.
205
Mike Frysinger6e89c962020-11-15 18:42:26 -0500206Attribute `dest-branch`: Name of a Git branch (e.g. `main`).
Bryan Jacobsf609f912013-05-06 13:36:24 -0400207Project elements not setting their own `dest-branch` will inherit
208this value. If this value is not set, projects will use `revision`
209by default instead.
210
Nasser Grainawida403412018-05-04 12:53:29 -0600211Attribute `upstream`: Name of the Git ref in which a sha1
212can be found. Used when syncing a revision locked manifest in
213-c mode to avoid having to sync the entire ref space. Project elements
214not setting their own `upstream` will inherit this value.
215
Mani Chandel7a91d512014-07-24 16:27:08 +0530216Attribute `sync-j`: Number of parallel jobs to use when synching.
David Pursehouse4e465202012-11-27 22:20:10 +0900217
Mani Chandel7a91d512014-07-24 16:27:08 +0530218Attribute `sync-c`: Set to true to only sync the given Git
David Pursehouse4e465202012-11-27 22:20:10 +0900219branch (specified in the `revision` attribute) rather than the
Mani Chandel7a91d512014-07-24 16:27:08 +0530220whole ref space. Project elements lacking a sync-c element of
David Pursehouse4e465202012-11-27 22:20:10 +0900221their own will use this value.
222
Mani Chandel7a91d512014-07-24 16:27:08 +0530223Attribute `sync-s`: Set to true to also sync sub-projects.
David Pursehouse4e465202012-11-27 22:20:10 +0900224
YOUNG HO CHAa32c92c2018-02-14 16:57:31 +0900225Attribute `sync-tags`: Set to false to only sync the given Git
226branch (specified in the `revision` attribute) rather than
227the other ref tags.
228
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800229
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400230### Element manifest-server
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700231
232At most one manifest-server may be specified. The url attribute
233is used to specify the URL of a manifest server, which is an
David Pursehouse9a27d012012-08-21 14:23:49 +0900234XML RPC service.
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700235
Mike Frysingerdfdf5772025-01-30 19:11:36 -0500236See the [smart sync documentation](./smart-sync.md) for more details.
David Pursehouse9a27d012012-08-21 14:23:49 +0900237
Nico Sallembiena1bfd2c2010-04-06 10:40:01 -0700238
LaMont Jonescc879a92021-11-18 22:40:18 +0000239### Element submanifest
240
241One or more submanifest elements may be specified. Each element describes a
242single manifest to be checked out as a child.
243
244Attribute `name`: A unique name (within the current (sub)manifest) for this
245submanifest. It acts as a default for `revision` below. The same name can be
246used for submanifests with different parent (sub)manifests.
247
248Attribute `remote`: Name of a previously defined remote element.
249If not supplied the remote given by the default element is used.
250
251Attribute `project`: The manifest project name. The project's name is appended
252onto its remote's fetch URL to generate the actual URL to configure the Git
253remote with. The URL gets formed as:
254
255 ${remote_fetch}/${project_name}.git
256
257where ${remote_fetch} is the remote's fetch attribute and
258${project_name} is the project's name attribute. The suffix ".git"
259is always appended as repo assumes the upstream is a forest of
260bare Git repositories. If the project has a parent element, its
261name will be prefixed by the parent's.
262
263The project name must match the name Gerrit knows, if Gerrit is
264being used for code reviews.
265
266`project` must not be empty, and may not be an absolute path or use "." or ".."
267path components. It is always interpreted relative to the remote's fetch
268settings, so if a different base path is needed, declare a different remote
269with the new settings needed.
270
271If not supplied the remote and project for this manifest will be used: `remote`
272cannot be supplied.
273
LaMont Jonesb308db12022-02-25 17:05:21 +0000274Projects from a submanifest and its submanifests are added to the
275submanifest::path:<path_prefix> group.
276
LaMont Jonescc879a92021-11-18 22:40:18 +0000277Attribute `manifest-name`: The manifest filename in the manifest project. If
278not supplied, `default.xml` is used.
279
280Attribute `revision`: Name of a Git branch (e.g. "main" or "refs/heads/main"),
281tag (e.g. "refs/tags/stable"), or a commit hash. If not supplied, `name` is
282used.
283
284Attribute `path`: An optional path relative to the top directory
285of the repo client where the submanifest repo client top directory
286should be placed. If not supplied, `revision` is used.
287
288`path` may not be an absolute path or use "." or ".." path components.
289
Peter Kjellerstedt75773b82025-11-08 02:36:56 +0100290Attribute `groups`: Set of additional groups to which all projects
LaMont Jonescc879a92021-11-18 22:40:18 +0000291in the included submanifest belong. This appends and recurses, meaning
292all projects in submanifests carry all parent submanifest groups.
293Same syntax as the corresponding element of `project`.
294
LaMont Jones501733c2022-04-20 16:42:32 +0000295Attribute `default-groups`: The list of manifest groups to sync if no
296`--groups=` parameter was specified at init. When that list is empty, use this
297list instead of "default" as the list of groups to sync.
LaMont Jonescc879a92021-11-18 22:40:18 +0000298
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400299### Element project
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800300
301One or more project elements may be specified. Each element
302describes a single Git repository to be cloned into the repo
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800303client workspace. You may specify Git-submodules by creating a
304nested project. Git-submodules will be automatically
305recognized and inherit their parent's attributes, but those
306may be overridden by an explicitly specified project element.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800307
308Attribute `name`: A unique name for this project. The project's
309name is appended onto its remote's fetch URL to generate the actual
310URL to configure the Git remote with. The URL gets formed as:
311
Mike Frysinger3891b752018-10-05 19:26:15 -0400312 ${remote_fetch}/${project_name}.git
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800313
314where ${remote_fetch} is the remote's fetch attribute and
315${project_name} is the project's name attribute. The suffix ".git"
David Pursehousedaa851f2012-08-21 13:52:18 +0900316is always appended as repo assumes the upstream is a forest of
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800317bare Git repositories. If the project has a parent element, its
318name will be prefixed by the parent's.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800319
320The project name must match the name Gerrit knows, if Gerrit is
321being used for code reviews.
322
Mike Frysinger68d5d4d2021-03-09 11:56:24 -0500323"name" must not be empty, and may not be an absolute path or use "." or ".."
324path components. It is always interpreted relative to the remote's fetch
325settings, so if a different base path is needed, declare a different remote
326with the new settings needed.
327These restrictions are not enforced for [Local Manifests].
328
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800329Attribute `path`: An optional path relative to the top directory
330of the repo client where the Git working directory for this project
Mike Frysinger68d5d4d2021-03-09 11:56:24 -0500331should be placed. If not supplied the project "name" is used.
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800332If the project has a parent element, its path will be prefixed
333by the parent's.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800334
Mike Frysinger68d5d4d2021-03-09 11:56:24 -0500335"path" may not be an absolute path or use "." or ".." path components.
336These restrictions are not enforced for [Local Manifests].
337
338If you want to place files into the root of the checkout (e.g. a README or
339Makefile or another build script), use the [copyfile] or [linkfile] elements
340instead.
341
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800342Attribute `remote`: Name of a previously defined remote element.
343If not supplied the remote given by the default element is used.
344
345Attribute `revision`: Name of the Git branch the manifest wants
346to track for this project. Names can be relative to refs/heads
Mike Frysinger6e89c962020-11-15 18:42:26 -0500347(e.g. just "main") or absolute (e.g. "refs/heads/main").
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800348Tags and/or explicit SHA-1s should work in theory, but have not
349been extensively tested. If not supplied the revision given by
Anthony King36ea2fb2014-05-06 11:54:01 +0100350the remote element is used if applicable, else the default
351element is used.
Shawn O. Pearce3e548192008-11-04 11:19:36 -0800352
Mike Frysinger6e89c962020-11-15 18:42:26 -0500353Attribute `dest-branch`: Name of a Git branch (e.g. `main`).
Bryan Jacobsf609f912013-05-06 13:36:24 -0400354When using `repo upload`, changes will be submitted for code
355review on this branch. If unspecified both here and in the
356default element, `revision` is used instead.
357
Peter Kjellerstedt75773b82025-11-08 02:36:56 +0100358Attribute `groups`: Set of groups to which this project belongs,
Conley Owens971de8e2012-04-16 10:36:08 -0700359whitespace or comma separated. All projects belong to the group
Conley Owensbb1b5f52012-08-13 13:11:18 -0700360"all", and each project automatically belongs to a group of
361its name:`name` and path:`path`. E.g. for
Jashank Jeremy97477472020-12-12 20:50:22 +1100362`<project name="monkeys" path="barrel-of"/>`, that project
Brian Harring7da13142012-06-15 02:24:20 -0700363definition is implicitly in the following manifest groups:
Conley Owensbb1b5f52012-08-13 13:11:18 -0700364default, name:monkeys, and path:barrel-of. If you place a project in the
365group "notdefault", it will not be automatically downloaded by repo.
Che-Liang Chioub2bd91c2012-01-11 11:28:42 +0800366If the project has a parent element, the `name` and `path` here
367are the prefixed ones.
Colin Cross5acde752012-03-28 20:15:45 -0700368
Mani Chandel7a91d512014-07-24 16:27:08 +0530369Attribute `sync-c`: Set to true to only sync the given Git
David Pursehouse4e465202012-11-27 22:20:10 +0900370branch (specified in the `revision` attribute) rather than the
371whole ref space.
372
Mani Chandel7a91d512014-07-24 16:27:08 +0530373Attribute `sync-s`: Set to true to also sync sub-projects.
David Pursehouse4e465202012-11-27 22:20:10 +0900374
Nasser Grainawi909d58b2014-09-19 12:13:04 -0600375Attribute `upstream`: Name of the Git ref in which a sha1
David Pursehouse4e465202012-11-27 22:20:10 +0900376can be found. Used when syncing a revision locked manifest in
377-c mode to avoid having to sync the entire ref space.
378
David Pursehouseede7f122012-11-27 22:25:30 +0900379Attribute `clone-depth`: Set the depth to use when fetching this
380project. If specified, this value will override any value given
381to repo init with the --depth option on the command line.
382
Scott Fandb83b1b2013-02-28 09:34:14 +0800383Attribute `force-path`: Set to true to force this project to create the
384local mirror repository according to its `path` attribute (if supplied)
385rather than the `name` attribute. This attribute only applies to the
386local mirrors syncing, it will be ignored when syncing the projects in a
387client working directory.
388
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400389### Element extend-project
Josh Triplett884a3872014-06-12 14:57:29 -0700390
391Modify the attributes of the named project.
392
393This element is mostly useful in a local manifest file, to modify the
394attributes of an existing project without completely replacing the
395existing project definition. This makes the local manifest more robust
396against changes to the original manifest.
397
398Attribute `path`: If specified, limit the change to projects checked out
399at the specified path, rather than all projects with the given name.
400
Michael Kelly37c21c22020-06-13 02:10:40 -0700401Attribute `dest-path`: If specified, a path relative to the top directory
402of the repo client where the Git working directory for this project
403should be placed. This is used to move a project in the checkout by
404overriding the existing `path` setting.
405
Peter Kjellerstedt75773b82025-11-08 02:36:56 +0100406Attribute `groups`: Set of additional groups to which this project
Josh Triplett884a3872014-06-12 14:57:29 -0700407belongs. Same syntax as the corresponding element of `project`.
408
Luis Hector Chavez7d525852018-03-15 09:54:08 -0700409Attribute `revision`: If specified, overrides the revision of the original
410project. Same syntax as the corresponding element of `project`.
411
Kyunam Jobd0aae92020-02-04 11:38:53 +0900412Attribute `remote`: If specified, overrides the remote of the original
413project. Same syntax as the corresponding element of `project`.
414
Erik Elmeke4cdfdb72022-09-09 17:13:17 +0200415Attribute `dest-branch`: If specified, overrides the dest-branch of the original
416project. Same syntax as the corresponding element of `project`.
417
418Attribute `upstream`: If specified, overrides the upstream of the original
419project. Same syntax as the corresponding element of `project`.
420
Fredrik de Groot303bd962024-09-09 15:54:57 +0200421Attribute `base-rev`: If specified, adds a check against the revision
422to be extended. Manifest parse will fail and give a list of mismatch extends
423if the revisions being extended have changed since base-rev was set.
424Intended for use with layered manifests using hash revisions to prevent
425patch branches hiding newer upstream revisions. Also compares named refs
426like branches or tags but is misleading if branches are used as base-rev.
427Same syntax as the corresponding element of `project`.
428
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400429### Element annotation
James W. Mills24c13082012-04-12 15:04:13 -0500430
431Zero or more annotation elements may be specified as children of a
Peter Kjellerstedt4ab22842025-10-16 20:29:28 +0200432project element, an extend-project element, or a remote element. Each
433element describes a name-value pair. For projects, this name-value pair
434will be exported into each project's environment during a 'forall'
435command, prefixed with `REPO__`. In addition, there is an optional
436attribute "keep" which accepts the case insensitive values "true"
437(default) or "false". This attribute determines whether or not the
Jack Neus6ea0cae2021-07-20 20:52:33 +0000438annotation will be kept when exported with the manifest subcommand.
James W. Mills24c13082012-04-12 15:04:13 -0500439
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400440### Element copyfile
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300441
442Zero or more copyfile elements may be specified as children of a
Peter Kjellerstedt4ab22842025-10-16 20:29:28 +0200443project element, or an extend-project element. Each element describes a
444src-dest pair of files; the "src" file will be copied to the "dest"
445place during `repo sync` command.
Mike Frysingerc5b172a2019-07-31 17:34:23 -0400446
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300447"src" is project relative, "dest" is relative to the top of the tree.
Mike Frysingerc5b172a2019-07-31 17:34:23 -0400448Copying from paths outside of the project or to paths outside of the repo
449client is not allowed.
450
451"src" and "dest" must be files. Directories or symlinks are not allowed.
452Intermediate paths must not be symlinks either.
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300453
Mike Frysinger50d27632019-08-01 18:57:10 -0400454Parent directories of "dest" will be automatically created if missing.
455
Peter Kjellerstedt412367b2025-11-08 00:06:16 +0100456The files are copied in the order they are specified in the manifests.
457If multiple elements specify the same source and destination, they will
458only be applied as one, based on the first occurence. Files are copied
459before any links specified via linkfile elements are created.
460
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400461### Element linkfile
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300462
Peter Kjellerstedt412367b2025-11-08 00:06:16 +0100463It's just like copyfile, but instead of copying it creates a symlink.
Ruslan Bilovol54527e72015-09-08 13:11:23 +0300464
Mike Frysingerc5b172a2019-07-31 17:34:23 -0400465The symlink is created at "dest" (relative to the top of the tree) and
Mike Frysinger04122b72019-07-31 23:32:58 -0400466points to the path specified by "src" which is a path in the project.
Mike Frysingerc5b172a2019-07-31 17:34:23 -0400467
Mike Frysinger50d27632019-08-01 18:57:10 -0400468Parent directories of "dest" will be automatically created if missing.
469
Mike Frysingerc5b172a2019-07-31 17:34:23 -0400470The symlink target may be a file or directory, but it may not point outside
471of the repo client.
472
Peter Kjellerstedt412367b2025-11-08 00:06:16 +0100473The links are created in the order they are specified in the manifests.
474If multiple elements specify the same source and destination, they will
475only be applied as one, based on the first occurence. Links are created
476after any files specified via copyfile elements are copied.
477
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400478### Element remove-project
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800479
Fredrik de Grootbe71c2f2023-05-31 16:56:34 +0200480Deletes a project from the internal manifest table, possibly
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800481allowing a subsequent project element in the same manifest file to
482replace the project with a different source.
483
David Pursehouseb1525bf2012-11-14 08:51:38 +0900484This element is mostly useful in a local manifest file, where
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800485the user can remove a project, and possibly replace it with their
486own definition.
487
Fredrik de Grootbe71c2f2023-05-31 16:56:34 +0200488The project `name` or project `path` can be used to specify the remove target
489meaning one of them is required. If only name is specified, all
490projects with that name are removed.
491
492If both name and path are specified, only projects with the same name and
493path are removed, meaning projects with the same name but in other
494locations are kept.
495
496If only path is specified, a matching project is removed regardless of its
497name. Logic otherwise behaves like both are specified.
498
Michael Kelly06da9982021-06-30 01:58:28 -0700499Attribute `optional`: Set to true to ignore remove-project elements with no
500matching `project` element.
501
Fredrik de Groot303bd962024-09-09 15:54:57 +0200502Attribute `base-rev`: If specified, adds a check against the revision
503to be removed. Manifest parse will fail and give a list of mismatch removes
504if the revisions being removed have changed since base-rev was set.
505Intended for use with layered manifests using hash revisions to prevent
506patch branches hiding newer upstream revisions. Also compares named refs
507like branches or tags but is misleading if branches are used as base-rev.
508Same syntax as the corresponding element of `project`.
509
Mike Frysinger51e39d52020-12-04 05:32:06 -0500510### Element repo-hooks
511
512NB: See the [practical documentation](./repo-hooks.md) for using repo hooks.
513
514Only one repo-hooks element may be specified at a time.
515Attempting to redefine it will fail to parse.
516
517Attribute `in-project`: The project where the hooks are defined. The value
518must match the `name` attribute (**not** the `path` attribute) of a previously
519defined `project` element.
520
521Attribute `enabled-list`: List of hooks to use, whitespace or comma separated.
522
Raman Tenneti1bb4fb22021-01-07 16:50:45 -0800523### Element superproject
524
525***
Raman Tenneti1c3f57e2021-05-04 12:32:13 -0700526*Note*: This is currently a WIP.
Raman Tenneti1bb4fb22021-01-07 16:50:45 -0800527***
528
529NB: See the [git superprojects documentation](
530https://en.wikibooks.org/wiki/Git/Submodules_and_Superprojects) for background
531information.
532
533This element is used to specify the URL of the superproject. It has "name" and
534"remote" as atrributes. Only "name" is required while the others have
535reasonable defaults. At most one superproject may be specified.
536Attempting to redefine it will fail to parse.
537
538Attribute `name`: A unique name for the superproject. This attribute has the
539same meaning as project's name attribute. See the
540[element project](#element-project) for more information.
541
542Attribute `remote`: Name of a previously defined remote element.
543If not supplied the remote given by the default element is used.
544
Xin Lie0b16a22021-09-26 23:20:32 -0700545Attribute `revision`: Name of the Git branch the manifest wants
546to track for this superproject. If not supplied the revision given
547by the remote element is used if applicable, else the default
548element is used.
549
Raman Tenneti1c3f57e2021-05-04 12:32:13 -0700550### Element contactinfo
551
552***
553*Note*: This is currently a WIP.
554***
555
556This element is used to let manifest authors self-register contact info.
557It has "bugurl" as a required atrribute. This element can be repeated,
558and any later entries will clobber earlier ones. This would allow manifest
559authors who extend manifests to specify their own contact info.
560
561Attribute `bugurl`: The URL to file a bug against the manifest owner.
562
Mike Frysingerb8f7bb02018-10-10 01:05:11 -0400563### Element include
Brian Harring26448742011-04-28 05:04:41 -0700564
565This element provides the capability of including another manifest
566file into the originating manifest. Normal rules apply for the
David Pursehouse9f3406e2012-11-14 08:52:25 +0900567target manifest to include - it must be a usable manifest on its own.
Brian Harring26448742011-04-28 05:04:41 -0700568
David Pursehouse9f3406e2012-11-14 08:52:25 +0900569Attribute `name`: the manifest to include, specified relative to
570the manifest repository's root.
Brian Harring26448742011-04-28 05:04:41 -0700571
Mike Frysinger68d5d4d2021-03-09 11:56:24 -0500572"name" may not be an absolute path or use "." or ".." path components.
573These restrictions are not enforced for [Local Manifests].
574
Peter Kjellerstedt75773b82025-11-08 02:36:56 +0100575Attribute `groups`: Set of additional groups to which all projects
Fredrik de Groot352c93b2020-10-06 12:55:14 +0200576in the included manifest belong. This appends and recurses, meaning
LaMont Jonescc879a92021-11-18 22:40:18 +0000577all projects in included manifests carry all parent include groups.
Peter Kjellerstedt47c24b52025-11-07 23:09:57 +0100578This also applies to all extend-project elements in the included manifests.
Fredrik de Groot352c93b2020-10-06 12:55:14 +0200579Same syntax as the corresponding element of `project`.
Shawn O. Pearce03eaf072008-11-20 11:42:22 -0800580
Shuchuan Zeng3e3340d2023-04-18 10:36:50 +0800581Attribute `revision`: Name of a Git branch (e.g. `main` or `refs/heads/main`)
Peter Kjellerstedt3073a902025-11-08 06:42:53 +0100582default to which all projects in the included manifest belong. This recurses,
583meaning it will apply to all projects in all manifests included as a result of
584this element.
Shuchuan Zeng3e3340d2023-04-18 10:36:50 +0800585
Mike Frysinger68d5d4d2021-03-09 11:56:24 -0500586## Local Manifests {#local-manifests}
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800587
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900588Additional remotes and projects may be added through local manifest
589files stored in `$TOP_DIR/.repo/local_manifests/*.xml`.
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800590
591For example:
592
Mike Frysinger3891b752018-10-05 19:26:15 -0400593 $ ls .repo/local_manifests
594 local_manifest.xml
595 another_local_manifest.xml
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900596
Mike Frysinger3891b752018-10-05 19:26:15 -0400597 $ cat .repo/local_manifests/local_manifest.xml
598 <?xml version="1.0" encoding="UTF-8"?>
599 <manifest>
600 <project path="manifest"
601 name="tools/manifest" />
602 <project path="platform-manifest"
603 name="platform/manifest" />
604 </manifest>
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800605
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900606Users may add projects to the local manifest(s) prior to a `repo sync`
Shawn O. Pearce70cd4ab2008-11-06 08:48:44 -0800607invocation, instructing repo to automatically download and manage
608these extra projects.
David Pursehouse2d5a0df2012-11-13 02:50:36 +0900609
David Pursehouse52f1e5d2012-11-14 04:53:24 +0900610Manifest files stored in `$TOP_DIR/.repo/local_manifests/*.xml` will
611be loaded in alphabetical order.
612
Raman Tenneti78f4dd32021-06-07 13:27:37 -0700613Projects from local manifest files are added into
614local::<local manifest filename> group.
615
Mike Frysinger4e1fc102020-09-06 14:42:47 -0400616The legacy `$TOP_DIR/.repo/local_manifest.xml` path is no longer supported.
Mike Frysinger68d5d4d2021-03-09 11:56:24 -0500617
618
619[copyfile]: #Element-copyfile
620[linkfile]: #Element-linkfile
621[Local Manifests]: #local-manifests