---
title: "Get worktree diff"
method: GET
path: "/v1/git/worktrees/{id}/diff"
tags: ["git"]
---

# Get worktree diff

`GET /v1/git/worktrees/{id}/diff`

Returns the diff for a worktree against its source branch, including all staged/unstaged changes

## Path parameters

- `id` string, required

## Response `200`

OK

- InternalHandlersWorktreeDiffResponse — Response containing git diff information for a worktree
  - `additions` integer — Number of lines added
  - `deletions` integer — Number of lines deleted
  - `diff` string — Raw git diff output
  - `files_changed` string[] — List of changed files
  - `summary` string — Diff summary

---

[API](https://skmtc.net/wandb/apis/catnip-container-api.md) · [All operations](https://skmtc.net/wandb/apis/catnip-container-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/wandb/catnip-container-api/versions/a075b0fa501a/schema)
