How to make git ignore all whitespaces?

2.4k views Asked by At

How can I make git completely ignore any whitespace? I don't care even if any whitespace exists. I just want git not to track any whitespace.

i.e I want git to never trouble me about whitespaces when I commit, create or apply patch, merge or anything.

Also I don't want git to remove any whitespace automatically!

1

There are 1 answers

0
otus On

There's no way to make git ignore whitespace changes, that I know, but you can disable warnings.

This should (globally) disable the warnings that are enabled by default:

git config --global core.whitespace -trailing-space,-space-before-tab

What changes you do make will still be part of your commits.