Using git rerere to merge known conflicts

While working on a feature branch, you probably like to merge daily or maybe more often, but often when you work on long-living feature branches, you end up in a situation where you have the same conflict occurring repeatedly.

Here, you can use git rerere which stands for reuse recorded resolution. Git rerere is not enabled by default but can be enabled with the following command:

$ git config rerere.enabled true

Tip

You can configure it globally by adding --global to the git config command.

How to do it…

Perform the following steps to merge the known conflicts:

  1. In the jgit repository folder, start by checking out a branch that tracks origin/stable-2.2:
    git checkout -b rerereExample --track origin/stable-2.2 ...

Get Git: Mastering Version Control now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.