| 1 | # Usage |
| 2 | |
| 3 | The main way to use delta is to configure it as the pager for git: see [Configuration](./configuration.md). |
| 4 | |
| 5 | 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: |
| 6 | |
| 7 | ```sh |
| 8 | delta /somewhere/a.txt /somewhere/else/b.txt |
| 9 | |
| 10 | git diff /somewhere/a.txt /somewhere/else/b.txt |
| 11 | ``` |
| 12 | |
| 13 | You can also use [process substitution](https://en.wikipedia.org/wiki/Process_substitution) shell syntax with delta, e.g. |
| 14 | |
| 15 | ```sh |
| 16 | delta <(sort file1) <(sort file2) |
| 17 | ``` |
| 18 | |
| 19 | In addition to git output, delta handles standard unified diff format, e.g. `diff -u a.txt b.txt | delta`. |
| 20 | |
| 21 | For Mercurial, you can add delta, with its command line options, to the `[pager]` section of `.hgrc`. |