How to make git diff --ignore-space-change the default

前端 未结 6 1902

I could probably setup an alias, but it seems like I should be able to set this as an option in the config file, only I don\'t see anyway to do it.

I only want the <

6条回答
  •  不知归路
    2020-12-04 21:18

    This doesn't answer your question exactly, but it's a way to achieve something similar for apply.

    From man git-config:

     apply.whitespace
           Tells git apply how to handle whitespaces, in the same way
           as the --whitespace option. See git-apply(1).
    

    So open up your ~/.gitconfig or ./.git/config/ and append

    [apply]
       whitespace = nowarn
    

    It might also not let you commit something that only changes whitespace, but I'm sure you can overrule that with some flags.

提交回复
热议问题