attach_git_remote
Attach a remote git repository to this project and optionally bind one of the user's own credentials: an SSH key (key_id from generate_ssh_key/add_ssh_key/list_ssh_keys) for ssh:// or git@host: addresses, or a GitHub/Gitee platform token for https:// addresses. Equivalent to the web app's git settings save. After attaching (and for public repos even without credentials), sync_from_git pulls the remote and push_git pushes to it. Only credentials owned by this user can be bound — referencing someone else's key_id fails as 'not found'.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project_id": "<project_id>",
"remote_url": "<remote_url>"
},
"name": "attach_git_remote"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | ||
| remote_url | Yes | ||
| ssh_key_id | No | ||
| default_branch | No | main | |
| platform_token_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |