git_push
MCP tools › Version control
Push a local branch (default current) to a remote (default its upstream's, else origin). Dry run by default: lists the commits the remote lacks, offline; dry_run=false needs the remote right. No plain force push: force_with_lease overwrites only if the remote branch still points at the given commit. Rejections return git's reason; missing credentials fail with auth_required. Azure DevOps SSH may report pq: false. Logged.
Its results carry text from git, web: the client is told to treat that as data, never as instructions.
| Capability | git.git_push |
|---|---|
| Area | Version control |
| Access | changes repository, remote |
| Reaches | process, network |
| Rights | remote, vcs-write |
| Dry run | dry_run, on unless the call turns it off |
Arguments
| Argument | Type | Description |
|---|---|---|
branch | string | Local branch (default: the current one). |
remote | string | Remote (default: the branch's upstream remote, else origin). |
set_upstream | boolean | Record the pushed branch as upstream. |
force_with_lease | string | Overwrite the remote branch only if it still points at this commit (no plain force push). |
dry_run | boolean | Only list the commits that would be sent, without network (default true). |
target | string | Branch name on the remote (default: the local name); current branch only. |
tags | boolean | Also push the annotated and lightweight tags on the pushed history; current branch only. |
Call it from a shell
ferris-idea call runs one tool with the rights and safe mode of ferris-idea mcp. Replace the folder and the placeholder values.
ferris-idea call ~/my-project git_pushInput schema as JSON
{ "type": "object", "properties": { "branch": { "description": "Local branch (default: the current one).", "type": [ "string", "null" ] }, "remote": { "description": "Remote (default: the branch's upstream remote, else `origin`).", "type": [ "string", "null" ] }, "set_upstream": { "description": "Record the pushed branch as upstream.", "type": [ "boolean", "null" ] }, "force_with_lease": { "description": "Overwrite the remote branch only if it still points at this commit (no plain force push).", "type": [ "string", "null" ] }, "dry_run": { "description": "Only list the commits that would be sent, without network (default true).", "type": [ "boolean", "null" ] }, "target": { "description": "Branch name on the remote (default: the local name); current branch only.", "type": [ "string", "null" ] }, "tags": { "description": "Also push the annotated and lightweight tags on the pushed history; current branch only.", "type": [ "boolean", "null" ] } }}