---
title: "overlane repo push"
description: "Commit files to a branch through the API"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.overlane.app/llms.txt
> Use this file to discover all available pages before exploring further.

# overlane repo push

{/* Generated by apps/docs/scripts/generate.mjs (CLI pages from the command registry in packages/cli). Do not edit; run `pnpm --filter @overlane/docs gen`. */}

Commits the given files (and deletions) as one commit on a branch, for agents and clients without a git binary. The guardrail rules run on the server first: a protected branch takes changes through a pull request, an agent's push to a protected branch waits for an approval, and a credential in a file is refused. With git installed, use `overlane repo token` and a normal push instead.

## Usage

```sh
overlane repo push repo --branch NAME --message TEXT [--file PATH...] [--delete PATH...] [--expect SHA] [--rewrite] [--parent SHA] [--check] [--approval ID] [--dry-run]
```

## Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `repo` | yes | The repository name or ID |

## Flags

| Flag | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `--branch` | string | yes |  | The branch to commit to |
| `--message` | string | yes |  | The commit message |
| `--file` | string (repeatable) | no |  | A text file to add or change; repeat for more |
| `--delete` | string (repeatable) | no |  | A path to delete; repeat for more |
| `--expect` | string | no |  | The commit the branch should be at (default: its current tip) |
| `--rewrite` | boolean | no |  | Allow a history rewrite on an unprotected branch: the commit is built on --parent instead of the tip |
| `--parent` | string | no |  | With --rewrite: the commit to build on (the orphaned commits become stale) |
| `--check` | boolean | no |  | Only ask the guardrails whether this push would be allowed (protection, rules, approvals); commit nothing |
| `--approval` | string | no |  | Run an action that an approval covers; get the ID from `overlane guard approvals list` |
| `--dry-run` | boolean | no |  | Print the requests and file changes this command would make, then stop. Needs no credentials. |

## Examples

```sh
overlane repo push app --branch feature/login --message "Add login" --file src/login.ts
overlane repo push app --branch main --message "Fix" --file a.ts --dry-run
overlane repo push app --branch main --message "Fix" --file a.ts --check
```

## Behavior

- Effect: `write` (changes local or hosted state).
- Needs credentials: yes. Uses the network: yes.
- Supports `--dry-run`: yes. Accepts `--force`: no.
- Machine-readable description: `overlane schema repo push`.

## Result

With `--json` (the default when stdout is not a terminal) the command prints this JSON Schema's shape on stdout.

```json
{
  "anyOf": [
    {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "tenantId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9_.:-]*$",
              "description": "tenant identifier"
            },
            "repoId": {
              "type": "string",
              "pattern": "^repo_[A-Za-z0-9]{6,40}$"
            },
            "ref": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "pattern": "^[A-Za-z0-9._/-]+$"
            },
            "before": {
              "anyOf": [
                {
                  "type": "string",
                  "pattern": "^(?:[0-9a-f]{40}|[0-9a-f]{64})$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "after": {
              "type": "string",
              "pattern": "^(?:[0-9a-f]{40}|[0-9a-f]{64})$"
            },
            "forced": {
              "type": "boolean"
            },
            "eventId": {
              "type": "string"
            },
            "sequence": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            },
            "replay": {
              "type": "boolean"
            }
          },
          "required": [
            "tenantId",
            "repoId",
            "ref",
            "before",
            "after",
            "forced",
            "eventId",
            "sequence",
            "replay"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "allowed": {
              "type": "boolean",
              "const": true
            }
          },
          "required": [
            "allowed"
          ],
          "additionalProperties": false
        }
      ]
    },
    {
      "type": "object",
      "properties": {
        "dryRun": {
          "type": "boolean",
          "const": true
        },
        "service": {
          "type": "string"
        },
        "requests": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "method": {
                "type": "string"
              },
              "path": {
                "type": "string"
              },
              "body": {},
              "note": {
                "type": "string"
              }
            },
            "required": [
              "method",
              "path"
            ],
            "additionalProperties": false
          }
        },
        "commands": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "writes": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "path": {
                "type": "string"
              },
              "action": {
                "type": "string",
                "enum": [
                  "write",
                  "append",
                  "delete"
                ]
              },
              "description": {
                "type": "string"
              }
            },
            "required": [
              "path",
              "action",
              "description"
            ],
            "additionalProperties": false
          }
        },
        "notes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "dryRun",
        "requests",
        "commands",
        "writes",
        "notes"
      ],
      "additionalProperties": false
    }
  ]
}
```

See [exit codes](/cli/#exit-codes) for the status the process returns.

Source: https://docs.overlane.app/cli/repo-push/index.mdx
