Skip to main content
GET
/
api
/
repos
/
{repo_name}
/
branches
/
diff
Get Branch Diff
curl --request GET \
  --url https://api.{cluster}.code.storage/api/repos/{repo_name}/branches/diff \
  --header 'Authorization: Bearer <token>'
{
  "base": "main",
  "branch": "feature/new-feature",
  "files": [
    {
      "bytes": 2048,
      "is_eof": true,
      "path": "src/main.go",
      "raw": "diff --git a/src/main.go b/src/main.go\n...",
      "state": "M"
    }
  ],
  "filtered_files": [
    {
      "bytes": 50000,
      "is_eof": true,
      "path": "package-lock.json",
      "state": "M"
    }
  ],
  "stats": {
    "additions": 50,
    "changes": 60,
    "deletions": 10,
    "files": 3
  }
}

Documentation Index

Fetch the complete documentation index at: https://code.storage/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

repo_name
string
required

Repository name. Names that contain / or any other character that is not safe in a URL path segment must be URL encoded so the value occupies a single path segment. For example pierre/example is sent as pierre%2Fexample. Plain names such as example can be sent as-is. The server URL-decodes the value before resolving the repository.

Query Parameters

branch
string
required

Branch name to diff.

base
string

Optional base branch or ref to diff against.

ephemeral
boolean

Whether branch should be resolved from the ephemeral namespace.

ephemeral_base
boolean

Whether base should be resolved from the ephemeral namespace.

path
string[]

Optional repeated path filter. Provide multiple path query values to restrict the diff to specific files or directories.

Response

Diff between a source branch and its base, suitable for pre-merge review.

Diff between a branch and its base, including aggregate stats and per-file changes.

base
string
required

The base branch or ref used for comparison.

Example:

"main"

branch
string
required

The branch name being diffed.

Example:

"feature/new-feature"

files
object[]
required

Files returned with inline diff content.

filtered_files
object[]
required

Files filtered out of inline diff output because of size or file-type rules.

stats
object
required

Aggregate diff statistics.