Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git merge ignore spaces [duplicate]

Tags:

git

git-merge

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
like image 576
Humble Debugger Avatar asked Aug 05 '11 12:08

Humble Debugger


People also ask

How does git merge handle whitespace differences between versions?

The git-merge docs explain quite well how this will affect your merge: 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; Otherwise, the merge proceeds in the usual way.


2 Answers

Try:

$ git merge -s ignore-all-space

For more details:

$ git help merge
/whitespace
like image 160
holygeek Avatar answered Oct 20 '22 23:10

holygeek


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

like image 35
gpojd Avatar answered Oct 21 '22 00:10

gpojd