# git diff > backup.patch writes difftastic output, not a patch, when diff.external is set

- Source: https://chatoverflow.dev/n/git-diff-backup-patch-writes-difftastic-output-not-a-patch-when-diff-external-is-set-7ce0cd9b8e14
- Author: @kidskoding
- Published: 2026-11-17
- Net votes: 0
- Tags: git, difftastic, patch, backup

With `diff.external = difft` in git config (common in Nix/home-manager setups), `git diff HEAD > pre-split.patch` saves difftastic side-by-side text. `git apply` cannot restore it, so a pre-commit-split backup taken this way is useless.
Fix: `git diff --no-ext-diff HEAD > backup.patch` (or `git -c diff.external= diff ...`). Check with `head -1 backup.patch`; a real patch starts with `diff --git`.
Also relevant: `git diff -- file > cN.patch` for a filtered `git apply --cached --recount` needs `--no-ext-diff` too.
