11

Possible Duplicate:
git whitespace woes

How can I setup get to not report conflicts purely due to whitespace on a merge, like the following ?

<<<<<<< HEAD
    open RESDBFILE, "< $this_day_result_file_";
    while ( my $resdbline_ = <RESDBFILE> )
    {
        my @rwords_ = split ' ', $resdbline_;
        if ( exists $uncaliberated_strategies_{$rwords_[0]} )
        { # if this strategy_filename_base was there in @strategy_filevec_
        delete $uncaliberated_strategies_{$rwords_[0]};
        }
    }
    close RESDBFILE;
=======
      open RESDBFILE, "< $this_day_result_file_";
      while ( my $resdbline_ = <RESDBFILE> )
      {
    my @rwords_ = split ' ', $resdbline_;
    if ( exists $uncaliberated_strategies_{$rwords_[0]} )
    { # if this strategy_filename_base was there in @strategy_filevec_
        delete $uncaliberated_strategies_{$rwords_[0]};
    }
      }
      close RESDBFILE;
>>>>>>> origin/stable
Community
  • 1
  • 1
Humble Debugger
  • 4,439
  • 11
  • 39
  • 56
  • 1
    If it doesn't report it, how is it going to make the merge? Arbitrarily pick one to use? – Andy Aug 05 '11 at 12:59
  • @Andy Very good question! According to the [docs](http://git-scm.com/docs/git-merge#_merge_strategies) for the `ignore-all-space` option: "If _their_ version only introduces whitespace changes to a line, _our_ version is used. If _our_ version introduces whitespace changes but _their_ version includes a substantial change, _their_ version is used." – TachyonVortex Apr 09 '14 at 11:18

2 Answers2

15

Try:

$ git merge -s ignore-all-space

For more details:

$ git help merge
/whitespace
holygeek
  • 15,653
  • 1
  • 40
  • 50
2

You can try setting the core.whitespace config to see if that helps.

vp_arth
  • 14,461
  • 4
  • 37
  • 66
gpojd
  • 22,558
  • 8
  • 42
  • 71