[!TIP]

  • difft is an external diff engine
  • delta and diff-highlight are pagers (they only prettify the unified diff git already produced)
TOOL TYPE IMPACT — examples
difft external diff
engine
it replaces git's diff computation, so anything git normally does at the diff layer is skippedtextconv is just one example:
  • textconv — diffs the raw blob, not the converted text (binary / JSON / hexdump drivers)
  • .gitattributes diff=<driver> — custom xfuncname hunk headers, wordRegex, etc.
  • render / normalize flags — --color-words, --word-diff, diff.colorMoved (zebra), -w / --ignore-*-space, diff.orderFile
  • output is not a unified patchgit apply / patch / most review tools can't consume it
  • still fine: --stat / --numstat / -S/-G pickaxe (git computes these, not the engine)
  • only --no-ext-diff bypasses it
delta pager
(restyles the diff
git already produced)
  • honors textconv, --color-words, etc. for free (they run upstream)
  • nothing to render when there's no diff → git log -1 (no -p) looks unchanged
  • --no-ext-diff does not disable it — use --no-pager
  • double-colors when color.diff=always (feed it --no-color)
  • chokes on non-unified input (e.g. piping difft's output → mangled)
diff-highlight same pager model as delta, lighter:
  • passes unknown lines through untouched → tolerant of foreign input
  • word-level emphasis only; no line numbers / side-by-side
  • --no-ext-diff does not disable it — use --no-pager

common

  • all make git diff / git log -p / git show output nicer to read
  • all are read-only rendering — they never change the repo or the actual diff data git generates
  • all should yield clean output on a non-tty (pipe / capture)

differences

ASPECT difft (difftastic) delta (git-delta) diff-highlight
category external diff — replaces git's diff engine pager — reads git's unified diff pager (perl filter), same class as delta
diff algorithm own structural / syntax-tree (AST) diff git's line-level diff; only recolors/reformats git's line-level diff; adds word-level emphasis
config entry [diff] external / GIT_EXTERNAL_DIFF [core] pager / [pager] <cmd> [core] pager / [pager] <cmd>
bypassed by git diff --no-ext-diff git --no-pager / git -c core.pager=cat auto-off on non-tty git --no-pager / auto-off on non-tty
can act as external? yes (it is the external) no — doesn't take GIT_EXTERNAL_DIFF's 7 positional args no — same as delta
line numbers / side-by-side / navigate side-by-side, syntax coloring line numbers, side-by-side, navigate, hyperlinks none, word-level emphasis only
parseable (for scripts/grep) no (own format, not unified) yes (with --no-pager it's git's native diff) yes (same as left)
install brew install difftastic brew install git-delta ships with git contrib $(brew --prefix git)/share/git-core/contrib/diff-highlight/diff-highlight

configuration

CONFIG delta
(pager)
diff-highlight
(pager)
difft
(external diff)
TO BE DEFAULT
[core]
  pager        = delta
[pager]
  diff         = delta
  log          = delta
[interactive]
  diffFilter   = delta --color-only
[core]
  pager = diff-highlight | less $LESS -F -x1,5 -X
[pager]
  diff  = diff-highlight | less
  log   = diff-highlight | less -FRXK
[diff]
  external = difft
[difftool "difftastic"]
  cmd = difft "$LOCAL" "$REMOTE"
STYLING
[delta]
  navigate                 = true
  line-numbers             = true
  side-by-side             = false
  wrap-max-lines           = unlimited
  hyperlinks               = false
  max-line-length          = 0
  syntax-theme             = Catppuccin Mocha
  minus-style              = syntax
  minus-emph-style         = syntax "#45293440"
  plus-style               = syntax
  plus-emph-style          = syntax "#2c3b3480"
  line-numbers-minus-style = "#f38ba8"
  line-numbers-plus-style  = "#a6e3a1"
  line-numbers-zero-style  = "#6c7086"
  zero-style               = syntax
  hunk-header-style        = omit
  file-style               = bold "#89b4fa"
  file-decoration-style    = "#585b70" ul
none — word-level emphasis only; tune the trailing less flags not via gitconfig — env vars:
DFT_DISPLAY=side-by-side
DFT_SYNTAX_HIGHLIGHT=on
DFT_BACKGROUND=dark
DFT_TAB_WIDTH=2
ON-DEMAND ALIAS
[alias]
  # redundant once delta is default
  dd = "!git --no-pager diff --no-ext-diff \"$@\" | delta"
[alias]
  dh = "!f() { git --no-pager diff --no-ext-diff \"$@\" | diff-highlight | less -RFX; }; f"
[alias]
  dft = -c diff.external=difft diff
  rd  = -c diff.external=difft diff @{u}..@
  pd  = -c diff.external=difft diff @{-1}..@
  nd  = -c diff.external=difft diff --name-status
FORCE-USE
one-off; ignores
current pager & engine
git --no-pager diff --no-ext-diff | delta
git --no-pager diff --no-ext-diff | diff-highlight | less -R
git --no-pager -c diff.external=difft diff --ext-diff
WAY TO BYPASS
git --no-pager diff
git -c pager.diff=false diff
# --no-ext-diff does NOT disable delta
git --no-pager diff
# auto-off when piped (it is a pager)
git diff --no-ext-diff

--no-ext-diff / --no-pager behavior matrix

COMMAND INTERACTIVE TERMINAL (TTY) PIPE / CAPTURE $(...) / | grep
git diff delta-rendered plain unified diff (pager auto-off)
git diff --no-ext-diff still delta (pager applies on tty; --no-ext-diff only disables external) plain unified diff ✅ (neither external nor pager applies)
git --no-pager diff plain unified diff (pager forced off) plain unified diff
git dft difftastic side-by-side difftastic text (not unified, not for parsing)

common pitfalls

PITFALL EXPLANATION
--no-ext-diff won't disable delta delta is a pager, not an external. For plain output on a tty, use --no-pager.
git log -1 "isn't using delta" no -p means no diff; delta passes it through. Verify with git log -p -1.
pager.<cmd> outranks core.pager to temporarily disable the diff pager use -c pager.diff=false, not -c core.pager=cat.
delta double-colors pre-colored input with color.diff=always, add --no-color before piping into delta.
pre-commit always uses --no-ext-diff + captured output neither difft nor delta applies to it; switching diff tools does not affect pre-commit.
Copyright © marslo 2020-2026 all right reserved,powered by GitbookLast Modified: 2026-08-26 04:22:12

results matching ""

    No results matching ""