Book Image

Git Version Control Cookbook

By : Aske Olsson, Rasmus Voss
Book Image

Git Version Control Cookbook

By: Aske Olsson, Rasmus Voss

Overview of this book

Table of Contents (19 chapters)
Git Version Control Cookbook
About the Authors
About the Reviewers

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


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
  2. Now, change the maven-compiler-plugin version to something personalized such as 2.5.2 like this is in line 211. If you run git diff, you should get a result very similar to the following:

    $ git diff
    diff --git a/pom.xml b/pom.xml
    index 085e00f..d5aec17...