Git Push
git_pushPush local Git commits to a remote repository to share code changes, create backups, and synchronize work with your team.
Instructions
Push changes to a remote repository. Uploads local commits to the remote branch.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Path to the Git repository. Defaults to session working directory set via git_set_working_dir. | . |
| remote | No | Remote name (default: origin). | |
| branch | No | Branch name (default: current branch). | |
| force | No | Force push (overwrites remote history). | |
| forceWithLease | No | Safer force push - only succeeds if remote branch is at expected state. | |
| setUpstream | No | Set upstream tracking relationship for the branch. | |
| tags | No | Push all tags to the remote. | |
| dryRun | No | Preview the operation without executing it. | |
| delete | No | Delete the specified remote branch. | |
| remoteBranch | No | Remote branch name to push to (if different from local branch name). | |
| confirmed | No | Explicit confirmation required for force push or branch deletion on protected branches (main, master, production, etc.). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| success | Yes | Indicates if the operation was successful. | |
| remote | Yes | Remote name that was pushed to. | |
| branch | Yes | Branch that was pushed. | |
| upstreamSet | Yes | Whether upstream tracking was set for the branch. | |
| pushedRefs | Yes | References that were successfully pushed. | |
| rejectedRefs | Yes | References that were rejected by the remote. |