Skip to content

Use DeltaView with Git ​

Start comparisons from a terminal, make DeltaView the tool Git opens for diffs and merge conflicts, and add a Compare with DeltaView entry to your file manager.

The delta-view command ​

bash
delta-view                    # open the home screen
delta-view LEFT RIGHT         # compare two folders or two files
delta-view --merge LOCAL BASE REMOTE --output MERGED   # three-way merge

Paths may be relative and may start with ~. Two folders open the folder view; two files open the file view.

DeltaView does not refuse to start over a bad argument. If a path does not exist, or you pair a folder with a file, the window opens with a short notice at the top and the home screen stays usable.

On Linux the command is delta-view. On Windows, the installer puts the program at C:\Program Files\DeltaView\delta_view.exe by default: use the full path, or add that folder to PATH.

All options are listed in the reference.

Set up git difftool ​

Git's difftool command opens changes in a visual tool instead of printing them. Run these once:

bash
git config --global diff.tool deltaview
git config --global difftool.deltaview.cmd 'delta-view "$LOCAL" "$REMOTE"'
git config --global difftool.prompt false

Then, inside a repository:

bash
git difftool                 # each changed file in turn
git difftool HEAD~3 -- lib/  # against an older commit
git difftool --dir-diff      # the whole change set as one folder comparison

TIP

--dir-diff (or -d) is the comfortable one. Git writes both sides to temporary folders and DeltaView opens them as a single folder comparison, so you walk the tree instead of going through files one at a time.

On Windows, put the full path in the command:

bash
git config --global difftool.deltaview.cmd '"C:/Program Files/DeltaView/delta_view.exe" "$LOCAL" "$REMOTE"'

Set up git mergetool ​

When a merge or rebase stops on a conflict, git mergetool opens each conflicted file in a merge tool. Run these once:

bash
git config --global merge.tool deltaview
git config --global mergetool.deltaview.cmd \
  'delta-view --merge "$LOCAL" "$BASE" "$REMOTE" --output "$MERGED"'
git config --global mergetool.deltaview.trustExitCode false
git config --global mergetool.keepBackup false

Then, when Git reports conflicts:

  1. Run git mergetool.

    DeltaView opens the first conflicted file as a three-way merge: your side on the left, their side on the right, and the result in the middle.

  2. Resolve the conflicts and press Ctrl + S.

    The result is written to the file in your working tree.

  3. Close the window. Git moves on to the next conflicted file.

  4. When every file is done, finish the merge as usual, for example with git commit.

What the two extra settings do:

  • trustExitCode false: Git treats a conflict as resolved when the merged file was written. DeltaView exits with status 0 whether or not you saved, so Git must not rely on the exit status.
  • keepBackup false: stops Git leaving *.orig files behind.

Compare from the file manager ​

The .deb and PPA packages include a script that adds a Compare with DeltaView entry to GNOME Files (Nautilus), Nemo and Caja. It is not enabled automatically. For GNOME Files:

bash
mkdir -p ~/.local/share/nautilus/scripts
ln -s /opt/delta_view/extras/compare-with-deltaview \
      ~/.local/share/nautilus/scripts/"Compare with DeltaView"

Nemo reads scripts from ~/.local/share/nemo/scripts and Caja from ~/.config/caja/scripts.

The entry appears under Scripts in the right-click menu.

You selectResult
Two folders or two filesOpens the comparison
Three filesOpens a three-way merge, in selection order: LOCAL, BASE, REMOTE
One itemRemembers it; run the script on another item to compare the two

Next steps ​