git合并重复冲突

时间:2012-09-17 10:35:33

标签: git merge

我有一个分支master和一个分支feature已从master签出。

master从其他开发人员那里获取提交,我会定期将master合并回feature,以便跟上其他分支机构的新发展。

但是,每次执行git merge master时,我在同一文件中都会遇到相同的冲突,尽管我之前解决了冲突并提交了更改。

关于这可能是什么原因以及如何预防它的任何想法?

谢谢!

1 个答案:

答案 0 :(得分:5)

首先考虑不将集成分支合并到功能分支中。

其次查看git rerere命令并使用它:

$ git config --global rerere.enabled true
  

NAME

  git-rerere - Reuse recorded resolution of conflicted merges
     

说明

  In a workflow employing relatively long lived topic branches,
  the developer sometimes needs to resolve the same conflicts
  over and over again until the topic branches are done (either
  merged to the "release" branch, or sent out and accepted upstream)