---
name: "batdiff"
section: "1"
platform: "linux"
package: "bat-extras"
version: "2024.08.24-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/batdiff"
---

# batdiff(1)

Diff a file against the current git index, or display the diff between two files.

## NAME

batdiff - Diff a file against the current git index, or display the diff between two files.

## DESCRIPTION

This script supports using delta as an alternative highlighter for diffs.

## USAGE

    batdiff \[OPTIONS\] FILE\
\
     batdiff \[OPTIONS\] FILE OTHER\_FILE\
\
     batdiff --staged

## ENVIRONMENT

| | |
| --- | --- |
| **Variable** | **Description** |
|
| *BATDIFF\_USE\_DELTA=true* | If *delta* is installed, use *delta* by default. |

## OPTIONS

| | | |
| --- | --- | --- |
| **Short** | **Long** | **Description** |
|
| *-C* | *--context=\[LINES\]* | The number of lines to show before and after the differing lines. |
|  | *--delta* | Display diffs using *delta*. |
|  | *--color* | Force color output. |
|  | *--no-color* | Force disable color output. |
|  | *--paging=\["never"/"always"\]* | Enable/disable paging. |
|  | *--pager=\[PAGER\]* | Specify the pager to use. |
|  | *--terminal-width=\[COLS\]* | Generate output for the specified terminal width. |
|  | *--staged* | Show staged changes. |

## CAVEATS

**When using** *bat* **as the printer:**

\- Syntax highlighting in diffs between two files is not supported.\
 \- Syntax highlighting in a single-file diff requires *bat* \>= 0.15.

**When using** *delta* **as the printer:**

\- The *--no-color* option does not remove all color output.
