Migrate through a manifest file

  • Tier: Free, Premium, Ultimate
  • Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated

Import Git repositories based on a manifest file like the one used by the Android repository. Use the manifest to import a project with many repositories like the Android Open Source Project (AOSP).

Prerequisites

  • Manifest import source enabled. If not enabled, ask your GitLab administrator to enable it. The Manifest import source is enabled by default on GitLab.com.
  • The Maintainer or Owner role on the destination top-level group to import to. You might want to create a new top-level group for the import.

Manifest file format

The manifest file must be an XML file up to 1 MB in size. The file must have:

  • One remote tag with a review attribute that contains a URL to a Git server.
  • project tags with a name and path attribute.

GitLab builds the URL to the repository by combining the URL from the remote tag with a project name. The path attribute is used to represent the project path in GitLab.

For example:

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

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

In this example, GitLab creates the following projects:

GitLabImport URL
https://gitlab.com/<group_name>/build/makehttps://android.googlesource.com/platform/build
https://gitlab.com/<group_name>/build/blueprinthttps://android.googlesource.com/platform/build/blueprint

Import the repositories

To import repositories by using a manifest file:

  1. In the upper-right corner, select Create new ( plus ) and New project/repository.
  2. Select Import project.
  3. Select Manifest file.
  4. Select a group you want to import to.
  5. Choose an XML-formatted manifest file to use.
  6. Select List available repositories. You are redirected to the import status page with a projects list based on the manifest file.
  7. To import:
    • All projects for the first time, select Import all repositories.
    • Individual projects again, select Re-import. Specify a new name and select Re-import again. Re-importing creates a new copy of the source project.