gitmerge

git merge repeating conflicts


I have a branch master and a branch feature which was checked out from master.

master gets commits pushed into it from other developers and I regularly merge master back into feature, so that it keeps up with new developments from other branches.

However, I keep getting the same conflicts in the same files every time I do a git merge master, although I resolved the conflict before and committed the changes.

Any ideas on what could be the cause for this and how to prevent it?

Thanks!


Solution

  • First consider not merging integration branches into feature branches.

    Second have a look to git rerere command and use it:

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