manifest.md 2.22 KB
Newer Older
1
2
# Import multiple repositories by uploading a manifest file

3
4
5
6
7
GitLab allows you to import all the required Git repositories
based on a manifest file like the one used by the
[Android repository](https://android.googlesource.com/platform/manifest/+/2d6f081a3b05d8ef7a2b1b52b0d536b2b74feab4/default.xml).
This feature can be very handy when you need to import a project with many
repositories like the Android Open Source Project (AOSP).
8

9
## Requirements
10

11
12
13
GitLab must be using PostgreSQL for its database, since
[subgroups](../../group/subgroups/index.md) are needed for the manifest import
to work.
14

15
Read more about the [database requirements](../../../install/requirements.md#database).
16

17
## Manifest format
18

19
20
21
22
23
A manifest must be an XML file. There must be one `remote` tag with a `review`
attribute that contains a URL to a Git server, and each `project` tag must have
a `name` and `path` attribute. GitLab will then build the URL to the repository
by combining the URL from the `remote` tag with a project name.
A path attribute will be used to represent the project path in GitLab.
24

25
Below is a valid example of a manifest file:
26
27
28
29
30
31
32
33
34
35

```xml
<manifest>
  <remote review="https://android-review.googlesource.com/" />

  <project path="build/make" name="platform/build" />
  <project path="build/blueprint" name="platform/build/blueprint" />
</manifest>
```

36
As a result, the following projects will be created:
37
38
39

| GitLab | Import URL |
|---|---|
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
| https://gitlab.com/YOUR_GROUP/build/make | https://android-review.googlesource.com/platform/build |
| https://gitlab.com/YOUR_GROUP/build/blueprint | https://android-review.googlesource.com/platform/build/blueprint |

## Importing the repositories

You can start the import with:

1. From your GitLab dashboard click **New project**
1. Switch to the **Import project** tab
1. Click on the **Manifest file** button
1. Provide GitLab with a manifest xml file
1. Select a group you want to import to (you need to create a group first if you don't have one)
1. Click **List available repositories**. At this point, you will be redirected
   to the import status page with projects list based on the manifest file.
1. Check the list and click **Import all repositories** to start the import.

    ![Manifest status](img/manifest_status.png)