根据官方git 文档:
git diff
-w, --ignore-all-space
Ignore whitespace when comparing lines. This ignores differences
even if one line has whitespace where the other line has none.
Run Code Online (Sandbox Code Playgroud)
然而,基本测试表明事实并非如此。
somefile.txt使用以下内容
创建:git add somefile.txtcp somefile.txt somefile.orig.txtsomefile.txt:
git diff -w somefile.txt > somefile.gitdiffdiff -uw somefile.orig.txt somefile.txt > …