---
title: "overlane repo diff"
description: "Show the full diff between two branches or commits"
---

> 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 diff

{/* 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`. */}

Shows what the head added since the two histories split (BASE...HEAD), with every changed file's hunks. Three forms read a diff: `overlane repo diff \<repo\> \<base\>...\<head\>` for a compare, `overlane repo show \<repo\> \<commit\>` for one commit against its first parent, and `overlane repo pr diff \<repo\> \<number\>` for a pull request. Unified text by default, --stat for counts only, --json for the structured diff. A file over 1 MB or 20,000 changed lines is listed with its counts and no hunks; a diff over 3,000 files or 10 MB stops there and says so.

## Usage

```sh
overlane repo diff repo range [--stat]
```

## Arguments

| Argument | Required | Description |
| --- | --- | --- |
| `repo` | yes | The repository name or ID |
| `range` | yes | BASE...HEAD: each side a branch name or a commit SHA |

## Flags

| Flag | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `--stat` | boolean | no |  | Counts per file only, no hunks |

## Examples

```sh
overlane repo diff app main...feature/add
overlane repo diff app main...feature/add --stat
overlane repo show app 4f2a9c1
overlane repo pr diff app 7
```

## Behavior

- Effect: `read` (changes nothing).
- Needs credentials: yes. Uses the network: yes.
- Supports `--dry-run`: no. Accepts `--force`: no.
- Machine-readable description: `overlane schema repo diff`.

## Result

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

```json
{
  "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}$"
    },
    "diff": {
      "type": "object",
      "properties": {
        "base": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^(?:[0-9a-f]{40}|[0-9a-f]{64})$"
            },
            {
              "type": "null"
            }
          ]
        },
        "head": {
          "type": "string",
          "pattern": "^(?:[0-9a-f]{40}|[0-9a-f]{64})$"
        },
        "files": {
          "maxItems": 3000,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "path": {
                "type": "string",
                "minLength": 1,
                "maxLength": 1000
              },
              "previousPath": {
                "anyOf": [
                  {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1000
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "added",
                  "modified",
                  "deleted",
                  "renamed",
                  "binary"
                ]
              },
              "additions": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "deletions": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "truncated": {
                "type": "boolean"
              },
              "hunks": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "oldStart": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "oldLines": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "newStart": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "newLines": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "lines": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string",
                            "enum": [
                              "context",
                              "add",
                              "delete"
                            ]
                          },
                          "oldLine": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "newLine": {
                            "anyOf": [
                              {
                                "type": "integer",
                                "exclusiveMinimum": 0,
                                "maximum": 9007199254740991
                              },
                              {
                                "type": "null"
                              }
                            ]
                          },
                          "text": {
                            "type": "string"
                          },
                          "noNewline": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "type",
                          "oldLine",
                          "newLine",
                          "text"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "oldStart",
                    "oldLines",
                    "newStart",
                    "newLines",
                    "lines"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "path",
              "previousPath",
              "status",
              "additions",
              "deletions",
              "truncated",
              "hunks"
            ],
            "additionalProperties": false
          }
        },
        "totals": {
          "type": "object",
          "properties": {
            "files": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "additions": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "deletions": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "files",
            "additions",
            "deletions"
          ],
          "additionalProperties": false
        },
        "truncated": {
          "type": "boolean"
        },
        "truncatedReason": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 200
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "base",
        "head",
        "files",
        "totals",
        "truncated",
        "truncatedReason"
      ],
      "additionalProperties": false
    },
    "view": {
      "type": "string",
      "enum": [
        "stat"
      ]
    }
  },
  "required": [
    "tenantId",
    "repoId",
    "diff"
  ],
  "additionalProperties": false
}
```

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

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