> ## Documentation Index
> Fetch the complete content index at: https://smallsharpsoftwaretools.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Review Changes With Delta


Whether you're looking at code or content, it's helpful to see the changes you've made to a file, or to compare a file to a previous version. If you're working within `git`, you're probably familiar with the `git diff` command. The [delta](https://dandavison.github.io/delta/) tool gives you more control over how you see what's different, and you can use it as a standalone tool, or with `git`.

Delta offers side-by-side diffs with line numbers, syntax highlighting, and built-in navigation support.

## What You Need

To complete this tutorial, you need

- [git](https://git-scm.com/downloads) installed on your local machine.
- Homebrew installed, which you can do by following the [Install Homebrew]({{< ref "homebrew" >}}) tutorial.

## Installing Delta

To install Delta, use your package manager to install the `git-delta` package, or get a [binary for your OS](https://github.com/dandavison/delta/releases). If you go the manual route, make sure to place the executable on your system `PATH`.

Once installed, you add configuration options to your global `~/.gitconfig` file:

```toml
[core]
    pager = delta

[interactive]
    diffFilter = delta --color-only

[delta]
    navigate = true
    light = true
    side-by-side = true

[merge]
    conflictstyle = diff3

[diff]
    colorMoved = default
```

With this configuration, you will get side-by-side diffs, rather than the inline diffs, which is great for comparing lots of text changes. Change the `light` option to `false` if you use a dark-mode terminal.

To test it out, create a couple of Markdown files:

```command
cat <<EOF > file1.md
This is the first file.
It has two lines.
EOF
```

```command
cat <<EOF > file2.md
This is the second file.
It has three lines.
Isn't that great?
EOF
```

With the files created, run `delta` to compare the files:

```command
delta file1.md file2.md
```

You'll see a side-by-side comparison, making it clear what's changed:

{{< postimage "images/delta-diff.png" "Delta side-by-side comparison" >}}

Delta works well as a standalone diff tool, but it integrates with Git's tooling as well.
When you use the `git diff` command, it'll invoke the `delta` command instead of the default view.

## Conclusion

Delta improves upon the traditional `git diff` command. Whether you use it as a standalone tool or as part of your Git workflow, Delta offers a clearer, more informative view of file differences.

