---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://sourcecraft.dev/portal/docs/en/cli-ref/src-pr-diff.md
  - https://sourcecraft.dev/portal/docs/ru/cli-ref/src-pr-diff.md
---
> **Documentation Index:** Fetch the complete configuration index at https://sourcecraft.dev/portal/docs/en/llms.txt

# src pr diff

Show the diff of a pull request using git.

If no PR number is specified, the command will attempt to find a PR
associated with the current branch.

By default uses three-dot diff (git diff target...source) which compares
against the merge-base between the PR source and target branches.
Use --two-dots for a simple two-dot diff (git diff target..source).

Any arguments after -- are passed directly to git diff (e.g., --name-only).

## Usage

`src pr diff [<number>] [-- <git-diff-args>...] [flags]`

### Examples

**Show diff of a pull request from active branch**

`src pr diff`

**Show diff of a pull request**

`src pr diff 1234`

**Show diff of a pull request from another repo**

`src pr diff 1234 -R myorg/myrepo`

**Show only file names changed (passing git arguments)**

`src pr diff -- --name-only`

**Show diff stats**

`src pr diff 123 -- --stat`

### Flags

| Flag | Description |
| --- | --- |
| `--two-dots` | Use two-dot diff instead of three-dot (merge-base) diff |

### Inherited flags

| Flag | Description |
| --- | --- |
| `--env string` | Override Sourcecraft environment (use 'src envs' to list available) |
| `--json string` | Output JSON, optionally filtered (--json or --json=field1,field2) |
| `--json-compact string` | Output compact JSON, optionally filtered |
| `-R, --repo string` | Select another repository using OWNER/REPO format |
| `-V, --verbose` | Enable debug logging output |

### Learn more

Use `src pr diff <subcommand> --help` for more information about a command.
