我有一个名为master
的分支和一个从master
检出的名为feature
的分支。
master
会接收其他开发者推送的提交,而我经常将master
合并回feature
,以便它跟上来自其他分支的新开发。
然而,每次执行git merge master
时,我都会在相同的文件中遇到相同的冲突,即使我之前已经解决了冲突并提交了更改。
有什么想法可以解决这个问题并防止它发生吗?
谢谢!
首先考虑不将集成分支合并到功能分支中。
其次,请看一下git rerere命令并使用它:
$ git config --global rerere.enabled true
NAME
git-rerere - Reuse recorded resolution of conflicted merges
DESCRIPTION
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)
git add
之后,git甚至将其从索引中删除,因为它与已存在的文件完全相同。 - borfast