summaryrefslogtreecommitdiff
path: root/manual/src/usage.md
blob: 9b4e301f6cc6f0fc503f7e7814458e9a3f317a0f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Usage

The main way to use delta is to configure it as the pager for git: see [Configuration](./configuration.md).

Delta can also be used as a shorthand for diffing two files, even if they are not in a git repo: the following two commands do the same thing:

```sh
delta /somewhere/a.txt /somewhere/else/b.txt

git diff /somewhere/a.txt /somewhere/else/b.txt
```

You can also use [process substitution](https://en.wikipedia.org/wiki/Process_substitution) shell syntax with delta, e.g.

```sh
delta <(sort file1) <(sort file2)
```

In addition to git output, delta handles standard unified diff format, e.g. `diff -u a.txt b.txt | delta`.

For Mercurial, you can add delta, with its command line options, to the `[pager]` section of `.hgrc`.