14

Is there a way to tell SourceTree to always ignore whitespace "conflicts" during merges? Something like the command-line call:

git merge -Xignore-space-change

as described at Merging without whitespace conflicts.

Community
  • 1
  • 1
William Jockusch
  • 26,513
  • 49
  • 182
  • 323

2 Answers2

26

SourceTree has an option for ignoring whitespace. It had added this option a couple of years back. You can visit this link for further info.

When in the File status or Log views, there's that gears dropdown below the file list (and right above the file changes). Click that and hit the Ignore whitespace option.

Gear for setting the whitespace ignore setting

Hope this helps.

ruffin
  • 16,507
  • 9
  • 88
  • 138
Vidya Sagar
  • 1,699
  • 3
  • 17
  • 28
  • 2
    It's only hide whitespaces in view. When file is moved into staged area whitespace changes are still there just not showed. Is there a way to actually ignore whitespaces and not to stage parts that are hidden ? – user3124812 Apr 30 '21 at 01:45
0

SourceTree merge ignore whitespace conflicts can done by custom action.

I created the custom action shell script that perform similar action but ignore all space that i use everyday, but you can change the script line 8 git merge parma from -Xignore-all-space to -Xignore-space-change to fit in your case. You can download the sourcetree custom action script - merge ignore white space, call the script in your sourcetree and pass the parma $SHA

For the difference -Xignore-all-space and -Xignore-space-change, you can refer official git advanced merging book and git merge ignore whitespace answer here