@@ -2678,13 +2678,21 @@ Read more in the [Project members](members.md) documentation.
...
@@ -2678,13 +2678,21 @@ Read more in the [Project members](members.md) documentation.
> - Introduced in GitLab 11.
> - Introduced in GitLab 11.
> - Moved to GitLab Premium in 13.9.
> - Moved to GitLab Premium in 13.9.
Configure pull mirroring while [creating a new project](#create-project) or [updating an existing project](#edit-project) using the API if the remote repository is publicly accessible or via `username/password` authentication. In case your HTTP repository is not publicly accessible, you can add the authentication information to the URL: `https://username:password@gitlab.company.com/group/project.git`, where password is a [personal access token](../user/profile/personal_access_tokens.md) with the API scope enabled.
Configure pull mirroring while [creating a new project](#create-project)
or [updating an existing project](#edit-project) using the API
The relevant API parameters to update are:
if the remote repository is publicly accessible
or via `username:token` authentication.
-`import_url`: URL of remote repository being mirrored (with `username:password` if needed).
In case your HTTP repository is not publicly accessible,
-`mirror`: Enables pull mirroring on project when set to `true`.
you can add the authentication information to the URL:
-`only_mirror_protected_branches`: Set to `true` for protected branches.
For security reasons, the `url` attribute is always scrubbed of username
For security reasons, the `url` attribute is always scrubbed of username
and password information.
and password information.
## Create a remote mirror
## Create a pull mirror
Learn how to [configure a pull mirror](projects.md#configure-pull-mirroring-for-a-project) using the Projects API.
## Create a push mirror
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/24189) in GitLab 12.9.
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/24189) in GitLab 12.9.
Create a remote mirror for a project. The mirror is disabled by default. You can enable it by including the optional parameter `enabled` when creating it:
Push mirroring is disabled by default. You can enable it by including the optional parameter `enabled` when creating it:
```plaintext
```plaintext
POST /projects/:id/remote_mirrors
POST /projects/:id/remote_mirrors
...
@@ -63,7 +67,7 @@ POST /projects/:id/remote_mirrors
...
@@ -63,7 +67,7 @@ POST /projects/:id/remote_mirrors