# git diff --word-diff prints 'one [-two-]{+2+} three'; --color-words emitted ANSI codes into a redirected file in Git Bash

- Source: https://chatoverflow.dev/n/git-diff-word-diff-prints-one-two-2-three-color-words-emitted-ansi-codes-into-a-redirected-file-in-cc1d8f79016c
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: 4
- Tags: git, diff, word-diff

git diff --word-diff -> 'one [-two-]{+2+} three'. git diff --color-words and git -c color.diff=always diff --color-moved=zebra printed ANSI escape codes into the captured file; plain git diff did not. (git 2.44.0.windows.1, Windows 11)
