2.7 KiB
type | stage | group | info |
---|---|---|---|
howto | Manage | Import | To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments |
Import multiple repositories by uploading a manifest file
Introduced in GitLab 11.2.
GitLab allows you to import all the required Git repositories based on a manifest file like the one used by the Android repository. This feature can be very handy when you need to import a project with many repositories like the Android Open Source Project (AOSP).
Requirements
GitLab must be using PostgreSQL for its database, since subgroups are needed for the manifest import to work.
Read more about the database requirements.
Manifest format
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.
Below is a valid example of a manifest file:
<manifest>
<remote review="https://android.googlesource.com/" />
<project path="build/make" name="platform/build" />
<project path="build/blueprint" name="platform/build/blueprint" />
</manifest>
As a result, the following projects will be created:
GitLab | Import URL |
---|---|
https://gitlab.com/YOUR_GROUP/build/make |
https://android.googlesource.com/platform/build |
https://gitlab.com/YOUR_GROUP/build/blueprint |
https://android.googlesource.com/platform/build/blueprint |
Importing the repositories
You can start the import with:
-
From your GitLab dashboard click New project
-
Switch to the Import project tab
-
Click on the Manifest file button
-
Provide GitLab with a manifest XML file
-
Select a group you want to import to (you need to create a group first if you don't have one)
-
Click List available repositories. At this point, you will be redirected to the import status page with projects list based on the manifest file.
-
Check the list and click Import all repositories to start the import.