git rerere手动解决方案

git rerere愉快地存储我的冲突解决方案,并在再次出现相同的冲突时自动应用它们.

但是,有时候,我遇到了一个与我不想自动合并的不同上下文的合并冲突.

有没有办法让git rerere记住冲突解决方案,但需要显式调用git rerere来应用它们?

为了清楚起见,我不打算git rerere clear或git rerere忘记,而是简单地说,除非明确指示,否则不会自动解决合并冲突(奖励,如果它可以在申请之前显示我提出的决议!)

最佳答案 我不知道如何不对特定的大块重新应用rerere.

你确实可以忘记文件的重新分辨率(
as discussed here),但不能只是一个大块.

您将不得不直接使用.git / rr-cache混乱,如mentioned in this patch

We record a previously seen conflict and its resolution in a
subdirectory of $GIT_DIR/rr-cache, and the name of the subdirectory
is computed by hashing the “shape” of the conflicted hunk.
When a similar-looking conflict is encountered later in the working tree,
git rerere” tries to replay the recorded resolution by running a
three-way merge to apply the change to go from the previous conflict
to the previous resolution to the current conflicted state.

点赞