根据官方git 文档:
git apply
--ignore-space-change, --ignore-whitespace
When applying a patch, ignore changes in whitespace in context lines if necessary.
Context lines will preserve their whitespace, and they will not undergo whitespace fixing
regardless of the value of the --whitespace option. New lines will still be fixed, though.
Run Code Online (Sandbox Code Playgroud)
然而,基本测试表明这是一个该死的谎言。
somefile.txt使用以下内容
创建:git add somefile.txtcp somefile.txt somefile.orig.txtsomefile.txt: