When will Git resolve conflicts using a previous resolution and how can I disable it?

2.2k Views Asked by At

Often Git solves conflicts based on previous resolutions.

Example:

Auto-merging <file>
CONFLICT (content): Merge conflict in <file>
Resolved '<file>' using previous resolution.
Exit 1
  1. When will Git decide to solve a conflict based on previous resolutions?

  2. How can I disable the automatic solving based on previous resolutions?

1

There are 1 best solutions below

0
Guildenstern On

This is a message from “git rerere”. It is invoked manually unless it is enabled (using Git config rerere.enabled set to true), i.e. set to run automatically when you resolve conflicts. And since you don’t know what it is then I must surmise that you have set it to that value.

When will Git decide to solve a conflict based on previous resolutions?

git-rerere(1) will run if a previous resolution has been recorded in the cache. Check if it exists with

ls .git/rr-cache

If this cache has old resolutions then you can remove them with:

git rerere gc

How can I disable the automatic solving based on previous resolutions?

I think you can just remove the cache:

rm -r .git/rr-cache/

And maybe disable new resolution recordings by setting rerere.enabled to false.