# GET /v1/sessions/{session_id}/git/diff

Source: <https://everruns.com/docs/api/operations/diff/>

GET

/v1/sessions/{session\_id}/git/diff

Select code samplecURL (shell:curl)

```js
const url = 'https://app.everruns.com/api/v1/sessions/example/git/diff?oid=example';
const options = {method: 'GET'};


try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```sh
curl --request GET \
  --url 'https://app.everruns.com/api/v1/sessions/example/git/diff?oid=example'
```

* Production APIapp.everruns.com/api/v1/sessions/{session\_id}/git/diff

## Parameters

### Path Parameters

**session\_id**

required

string

Session ID

### Query Parameters

**oid**

required

string

Commit OID to diff

**base**

string

Base commit OID (default: parent)

## Responses

### 200

Diff result

Media typeapplication/json

A diff with full patch output

object

**entries**

required

Per-file change records. Empty when the two trees are identical.

Array\<object>

A diff entry between two commits

object

**old\_path**

Pre-change path. Only set when `status == "renamed"`; otherwise `None` (including for `added`/`deleted`/`modified`).

string | null

**path**

required

File path on the “new” side of the diff (the post-change path). For a rename, the pre-rename path is in `old_path`. Repo-root-relative, forward-slash separated.

string

**status**

required

Current lifecycle status.

string

**patch**

Unified-diff patch text covering all `entries`, truncated to \~64 KiB (with a trailing `... (truncated)` marker when the cap is hit). `None` when the diff produced no patch text — typically because the two trees are identical.

string | null

**stats**

required

Aggregate line/file counts across `entries`.

object

**deletions**

required

Total removed lines summed across all files (the `-` count in a unified diff).

integer

**files\_changed**

required

Number of files with at least one changed line (matches the length of `GitDiff.entries`).

integer

**insertions**

required

Total added lines summed across all files (the `+` count in a unified diff).

integer

##### Examplegenerated

```json
{
  "entries": [
    {
      "old_path": "example",
      "path": "example",
      "status": "example"
    }
  ],
  "patch": "example",
  "stats": {
    "deletions": 1,
    "files_changed": 1,
    "insertions": 1
  }
}
```

### 400

Invalid commit OID

### 404

Commit not found