【问题标题】:Git merge ignore spaces [duplicate]Git合并忽略空格[重复]
【发布时间】:2011-08-05 12:55:57
【问题描述】:

可能重复:
git whitespace woes

如何设置 get 以不报告纯粹由于合并中的空白而导致的冲突,如下所示?

<<<<<<< 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

【问题讨论】:

  • 如果不报,怎么合并?随便挑一个用?
  • @Andy 很好的问题!根据docsignore-all-space 选项:“如果their 版本只对一行引入空白更改,则使用our 版本。如果our 版本引入了空白更改,但 他们的 版本包含了实质性的更改,他们的 版本被使用。"

标签: git git-merge


【解决方案1】:

试试:

$ git merge -s ignore-all-space

更多详情:

$ git help merge
/whitespace

【讨论】:

  • git merge -Xignore-all-space 为我工作......也许它是一个版本的东西......
  • git cherry-pick -Xignore-all-space 也是如此。至少在(几乎)当前版本上。
【解决方案2】:

您可以尝试设置core.whitespace config 看看是否有帮助。

【讨论】:

  • 不会的。 core.whitespaces 是关于要警告的一组问题,而不是关于合并。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-05-18
  • 2011-02-07
  • 2016-01-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-03-01
相关资源
最近更新 更多