Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Have git rerere automatically mark files as resolved?

I'm using git rerere, and it is useful, but there is one problem: When it automatically resolves a file, it does not mark it as resolved (eg with git add). So if I run 'git mergetool', it opens up the file as if it still has all the conflicts in it.

So far, I've made a small shell script which I can call, which scans all files marked as conflicted for conflict markers (eg >>>>>>>), and calls git-add on them if they have none.

Is there a better way of doing this? Some flag to git rerere I missed?

like image 886
davr Avatar asked Jul 19 '10 17:07

davr


People also ask

How does git Rerere work?

The git rerere functionality is a bit of a hidden feature. The name stands for “reuse recorded resolution” and, as the name implies, it allows you to ask Git to remember how you've resolved a hunk conflict so that the next time it sees the same conflict, Git can resolve it for you automatically.

What does git rebase -- skip do?

You can run git rebase --skip to completely skip the commit. That means that none of the changes introduced by the problematic commit will be included. It is very rare that you would choose this option. You can fix the conflict.


1 Answers

Maybe a git config setting can help:

rerere.autoupdate

When set to true, git-rerere updates the index with the resulting contents after it cleanly resolves conflicts using previously recorded resolution.
Defaults to false.

Note: since Git1.7.0,

"git rerere" had rerere.autoupdate configuration but there was no way to countermand it from the command line;
--no-rerere-autoupdate option given to "merge", "revert", etc. fixes this.

like image 178
VonC Avatar answered Oct 13 '22 01:10

VonC