How to show space and tabs with git-diff

后端 未结 2 901
广开言路
广开言路 2020-12-14 14:50

I have the following output with git-diff.

- // sort list based on value    
+ // sort list based on value

How can I see easily see the num

2条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-14 15:39

    I can think of multiple options:

    • Configure Git to use colors: git config --global color.ui true. Whitespace at the end of lines is now highlighted in red.

    • Pipe the output of git diff through cat: git diff | cat -A. The -A flag tells cat to show non-printable characters (e.g. ^I for tab).

提交回复
热议问题