By default most git commands will make trailing whitespace stand out by marking
it red. This makes it almost impossible to miss these when using git add -p
,
git diff
, git show -p
and the like.
We can fairly easily also achieve this effect for tabs.
Include the following line(s) into your git config:
…
[core]
…
whitespace = tab-in-indent diff --check,tab-in-indent
…
…
Start a new bash session, find a git project, enter some random tabs in the mix
and see what you're about to commit: git diff
.
Or add your changes with git add -p
and use the interaction to step through
the changes.