Create a push mirror
POST
/api/v4/projects/{id}/remote_mirrors
Creates a push mirror.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Request Body required
Section titled “ Request Body required ” Media type application/json
object
url
required
The URL for a remote mirror
string
Example
https://*****:*****@example.com/gitlab/example.git enabled
Determines if the mirror is enabled
boolean
auth_method
Determines the mirror authentication method
string
keep_divergent_refs
Determines if divergent refs are kept on the target
boolean
only_protected_branches
Determines if only protected branches are mirrored
boolean
mirror_branch_regex
Determines if only matched branches are mirrored
string
host_keys
SSH host keys in bare format (ssh-ed25519 AAAA…) or full known_hosts format (hostname ssh-ed25519 AAAA…). Bare keys use the hostname from the mirror URL.
Array<string>
Responses
Section titled “ Responses ”Created
Media type application/json
object
id
integer format: int64
enabled
boolean
url
string
update_status
string
last_update_at
string format: date-time
last_update_started_at
string format: date-time
last_successful_update_at
string format: date-time
last_error
string
only_protected_branches
boolean
keep_divergent_refs
boolean
auth_method
string
host_keys
Array<object>
object
fingerprint_sha256
string
mirror_branch_regex
string
Example
{ "id": 101486, "enabled": true, "url": "https://*****:*****@example.com/gitlab/example.git", "update_status": "finished", "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:31:55.864Z", "last_error": "The remote mirror URL is invalid.", "auth_method": "password", "host_keys": [ { "fingerprint_sha256": "SHA256:abcd1234" } ], "mirror_branch_regex": "feature-.*"}Bad request
Unauthorized
Not found