Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7821673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:43:18+00:00 2026-06-02T07:43:18+00:00

Ok, here goes my Q. Does git rerere compare hashes of two files to

  • 0

Ok, here goes my Q. Does “git rerere” compare hashes of two files to figure out the resolution? That is, say I have an XML file which contains this tag:

<number>12</number>

When I have a conflict, that number usually gets changed to something like 13, 14, etc, so I’m stuck with:

<<<<<<<
<number>12</number>
=======
<number>13</number>
>>>>>>>

Can rerere automatically resolve this conflict even if the numbers are not the same as the last time? I always want it to resolve it in such a way that it takes the higher number (in example above, 13). So if it records the resolution for numbers 12 and 13, will it resolve conflict with different numbers? I have a suspicion it won’t, but might as well ask.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T07:43:19+00:00Added an answer on June 2, 2026 at 7:43 am

    Can rerere automatically resolve this conflict even if the numbers are not the same as the last time? I always want it to resolve it in such a way that it takes the higher number (in example above, 13).

    No, git rerere can’t do that.

    When you use git rerere, you’re asking it to remember two things:

    • a specific conflict (that is, the literal text of the hunks which are in conflict and the files that they’re in); and
    • the resolution that should be applied to that conflict

    Because these are hunk literals (e.g. “replace 12 with 13”) rather than some kind of transformation function (e.g. “replace N with N + 1”), git is unable to infer that you want to replace each number with a higher one.

    If git later encounters a conflict that doesn’t match any of its previously remembered conflicts, it’s just as if it’s never encountered that conflict at all, even if it might be similar (as in your example where the numbers are always one off).

    One way out is possible if this XML file is automatically generated. In that case, you might want to consider not keeping it in source control at all, and instead, generating it at runtime. Then you’ll never have the corresponding conflicts to clean up.

    Another approach is to avoid git rerere altogether, and instead write a custom merge driver that will resolve things for you. I’ve done this before, but it’s a non-trivial amount of work, and it requires you to write and test some code. If you’re interested in this strategy, see the link in Karl’s answer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here goes: I have an application that does some processing, writes some result files
First post, so here goes. I'm writing a script that does intelligent search and
Ok here goes: I have a SELECT drop down option with US state names
Weird to describe but here goes. I have a table with several rows. One
I'm sure the answer is somehow logical but here goes. I have three big
Ok, first question so here goes, A function that runs on activation of a
A slightly archaic question I'm afraid but here goes: I have a program which
This is a brain-dead newbie question, but here goes: What determines what files get
Have searched for the answer but no joy, so here goes... I'm working on
Can't figure this one out. Done research, searched here, online, etc. Still a new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.