Git diff -w ignore whitespace only at start & end of lines

后端 未结 2 1773
失恋的感觉
失恋的感觉 2021-01-29 17:08

I love to use git diff -w to ignore whitespace differences. But, I just noticed that it ignores even whitespace differences in the middle of lines. How could I only

2条回答
  •  伪装坚强ぢ
    2021-01-29 17:51

    For end of line use:

    git diff --ignore-space-at-eol
    

    Instead of what are you using currently:

    git diff -w (--ignore-all-space)
    

    For start of line... you are out of luck if you want a built in solution.

    However, if you don't mind getting your hands dirty there's a rather old patch floating out there somewhere that adds support for "--ignore-space-at-sol".

提交回复
热议问题