threads / discuss / 48020

git rerere to remember half-merged progress - valid use?

Subject: git rerere to remember half-merged progress - valid use?

## tl;dr

2 messages between Mar 10, 2018 and Mar 11, 2018.

replies: 1people: 2as markdown or json

Ilya Kantor· Mar 10, 2018, 14:22 UTC · lore
Hi,

Let's say I'm merging a branch with many conflicts. I resolved some of them, but then can't proceed or need to switch elsewhere.

Will it be a good practice to call `git rerere` to remember resolved conflicts, so that in the future when I re-merge, I get my half-done merge back?

I couldn't find such use of rerere in the internet.
How can I save the merge/restore progress otherwise?

--- Best Regards, Ilya Kantor

Junio C Hamano· Mar 11, 2018, 00:00 UTC · re: Ilya Kantor · lore

Re: git rerere to remember half-merged progress - valid use?

Ilya Kantor <iliakan@gmail.com> writes:
Show 6 quoted lines
> Let's say I'm merging a branch with many conflicts.
> I resolved some of them, but then can't proceed or need to switch elsewhere.
>
> Will it be a good practice to call `git rerere` to remember resolved
> conflicts, so that in the future
> when I re-merge, I get my half-done merge back?
As many of real world issues, the answer is "it depends".  

If you are absolutely sure about what you have resolved so far, then recording the resolutions for files that you have finished while there are still other files with conflicts to be resolved before switching away to another task is a very sensible thing to do.

On the other hand, recording resolutions you are not sure about means more work for you when you come back and attempt the merge again, as you would need to check resolutions of which files need to be nuked and redone (using "checkout -m" and "rerere forget").

My personal strategy is to avoid abandoning conflict resolution in the middle in the first place ;-), but in many cases I can be quite confident that I resolved conflicts in a file correctly without looking at conflicts in other files, so I do not think it is a bad practice to record resolution of files you resolved so far by calling "rerere" manually.

← back to recent threads