> ## Documentation Index
> Fetch the complete documentation index at: https://docs.diversion.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# diff

> Diversion の diff コマンドで、ブランチやコミット間の変更を比較し、バージョンを明確に把握しましょう。

`diff` コマンドを使用すると、現在のワークスペース、ブランチ、コミット、またはタグ間の変更を比較できます。

```bash theme={null}
dv diff [paths...] [--base <ref>] [--compare <ref>] [--name-status] [--color <auto|always|never>]
```

`[paths...]` は比較するファイルまたはディレクトリです。省略された場合、Diversion はリポジトリ全体を比較します。

`[--base <ref>]` は比較元のベース参照(ブランチ名、コミット ID、またはタグ)を設定します。デフォルトはワークスペースのベースコミットです。

`[--compare <ref>]` は比較先の参照(ブランチ名、コミット ID、またはタグ)を設定します。デフォルトは現在のワークスペースです。

`[--name-status]` は、変更されたファイルの名前とステータスのみを表示します(A=追加、M=変更、D=削除、R=名前変更)。

`[--color <auto|always|never>]` はカラー出力を制御します。デフォルトは `auto` です。

たとえば、2 つのブランチ間で何が変更されたかを確認するには:

```bash theme={null}
dv diff --base main --compare feature-branch
```

変更されたファイルのサマリだけを確認するには:

```bash theme={null}
dv diff --name-status
```
