Skip to content

Update project pull mirroring settings

PUT
/api/v4/projects/{id}/mirror/pull

Updates pull mirroring settings for a specified project. This feature was introduced in GitLab 17.5.

id
required
One of:
string

The ID or URL-encoded path of the project

Media type application/json
object
enabled

Enables pull mirroring in a project

boolean
nullable
url

URL of the project to pull mirror

string
nullable
auth_user

The username used for authentication of a project to pull mirror

string
nullable
auth_password

The password used for authentication of a project to pull mirror or a personal access token with the api scope enabled.

string
nullable
mirror_trigger_builds

Pull mirroring triggers builds

boolean
nullable
only_mirror_protected_branches

Only mirror protected branches

boolean
nullable
mirror_overwrites_diverged_branches

Pull mirror overwrites diverged branches

boolean
nullable
mirror_branch_regex

Only mirror branches with names that match this regex

string
nullable
only_protected_branches
string
nullable
Example generated
{
"enabled": true,
"url": "example",
"auth_user": "example",
"auth_password": "example",
"mirror_trigger_builds": true,
"only_mirror_protected_branches": true,
"mirror_overwrites_diverged_branches": true,
"mirror_branch_regex": "example",
"only_protected_branches": "example"
}

OK

Media type application/json
object
id
integer format: int64
update_status
string
url
string
last_error
string
last_update_at
string format: date-time
last_update_started_at
string format: date-time
last_successful_update_at
string format: date-time
enabled
boolean
mirror_trigger_builds
boolean
only_mirror_protected_branches
boolean
mirror_overwrites_diverged_branches
boolean
mirror_branch_regex
string
Example
{
"id": 101486,
"update_status": "finished",
"url": "https://*****:*****@gitlab.com/gitlab-org/security/gitlab.git",
"last_update_at": "2020-01-06T17:32:02.823Z",
"last_update_started_at": "2020-01-06T17:32:02.823Z",
"last_successful_update_at": "2020-01-06T17:32:02.823Z",
"enabled": false,
"mirror_trigger_builds": false,
"only_mirror_protected_branches": false,
"mirror_overwrites_diverged_branches": false,
"mirror_branch_regex": "branch_name"
}

Url is blocked: Only allowed schemes are http, https, ssh, git

Not Found