我有一个分支master
和一个分支feature
已从master
签出。
master
从其他开发人员那里获取提交,我会定期将master
合并回feature
,以便跟上其他分支机构的新发展。
但是,每次执行git merge master
时,我在同一文件中都会遇到相同的冲突,尽管我之前解决了冲突并提交了更改。
关于这可能是什么原因以及如何预防它的任何想法?
谢谢!
答案 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)