11

I would like that whenever I run git diff or git show it silently automatically appends --ignore-all-space. Is there a way to do this? I know that I can create aliases like this:

[alias]
   sh = show --ignore-all-space
   di = diff --ignore-all-space

But I would like to use the diff and show commands directly.

Charles Finkel
  • 1,540
  • 2
  • 10
  • 12

2 Answers2

4

I do not think so:

  • I do not see any "--ignore-all-space" option for git show

  • I cannot see git diff having the --ignore-all-space set automatically: it has to be passed as argument.

One solution for git diff at least would be to use git difftool.
Since it is a script (in <git>/libexec/git-core), you could modify that script to call git diff with that option always set.

But, that may not prove a good idea, since it can lead to ignore changes that not even you, the sender, had any chance to detect and test.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
-1

Take a look at the core.whitespace configuration variable.

Ben Stiglitz
  • 3,994
  • 27
  • 24