Git tips & tricks

Show invisible differences

Highlight whitespace errors (i.e. trailing whitespaces, and space+tab in indent):

git diff --ws-error-highlight=all

Show whitespace and other non-printing characters:

git diff | cat -A

h/t: https://stackoverflow.com/a/58037244