Another approach would be a visual one, possible with Git 2.14.x/2.15 (Q3 2017), since "git diff
" has been taught to optionally paint new lines that are
the same as deleted lines elsewhere differently from genuinely new
lines.
In other words: dedicated color for moved lines
See commit 61e89ea, commit 86b452e, commit 176841f, commit 2e2d5ac, commit e6e045f, commit 146fdb0, commit 30b7e1e, commit bd03329, commit 0911c47, commit 4eed0eb, commit f359713, commit 5af6ea9, commit 4acaaa7, commit a29b0a1, commit 3ee8b7b, commit f2bb121, commit ff95867, commit 091f8e2, commit b9cbfde, commit 68abc6f (30 Jun 2017) by Stefan Beller (stefanbeller
).
(Merged by Junio C Hamano -- gitster
-- in commit b6c4058, 27 Aug 2017)
The git config
documentation now includes:
diff.colorMoved
If set to either a valid <mode>
or a true value, moved lines in a diff are colored differently, for details of valid modes see '--color-moved
' in git-diff
.
If simply set to true
, the default color mode will be used.
When set to false
, moved lines are not colored.
For more, see commit 2e2d5ac.