doc/user/project/import/repo_by_url.md
{{< details >}}
{{< /details >}}
You can import your existing repositories by providing the Git URL. You can't import GitLab issues and merge requests this way. Other methods provide more complete import methods.
If the repository is too large, the import might time out.
You can import your Git repository by:
{{< history >}}
{{< /history >}}
Your newly created project is displayed.
Imports of large repositories might time out after three hours. To import a timed-out project:
Clone the repository.
git clone --mirror https://example.com/group/project.git
The --mirror option ensures all branches, tags, and refs are copied.
Add the new remote repository.
cd repository.git
git remote add new-origin https://gitlab.com/group/project.git
Push everything to the new remote repository.
git push --mirror new-origin
You can use the Projects API to import a Git repository:
curl --location "https://gitlab.example.com/api/v4/projects/" \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your-token>' \
--data-raw '{
"description": "New project description",
"path": "new_project_path",
"import_url": "https://username:[email protected]/group/project.git"
}'
Some providers do not allow a password and instead require an access token.