简体   繁体   English

git rerere手动解决方案

[英]git rerere manual resolution only

git rerere happily stores my conflict resolutions and automagically applies them when the same conflicts appear again. git rerere愉快地存储我的冲突解决方案,并在再次出现相同的冲突时自动应用它们。

However, sometimes, I encounter a merge conflict with a different context that I don't want auto merged. 但是,有时候,我遇到了一个与我不想自动合并的不同上下文的合并冲突。

Is there a way to make git rerere remember conflict resolutions, but require an explicit call to git rerere to apply them? 有没有办法让git rerere记住冲突解决方案,但需要显式调用git rerere来应用它们?

To be clear, I'm not looking to git rerere clear or git rerere forget , but rather, simply, not automatically resolve merge conflicts unless explicitly directed (bonus if it can show me the proposed resolution before applying!) 为了清楚git rerere clear ,我不打算git rerere cleargit rerere forget ,而是简单地说,除非明确指示,否则不会自动解决合并冲突(奖励,如果它可以在申请之前显示我提出的决议!)

I don't know of a way to not apply rerere for a particular hunk. 我不知道如何不对特定的大块重新应用rerere。
You can indeed forget rerere resolution for a file ( as discussed here ), but not for just a hunk. 你确实可以忘记文件的rerere解析( 如这里所讨论的 ),但不仅仅是一个大块头。

You would have to mess directly with .git/rr-cache, as mentioned in this patch : 您将不得不直接使用.git / rr-cache混乱,如此补丁中所述

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. 我们在$GIT_DIR/rr-cache的子目录中记录先前看到的冲突及其解析,并且通过散列冲突的块的“形状”来计算子目录的名称。
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. 当工作树中稍后遇到类似外观的冲突时,“ git rerere ”会尝试通过运行三向合并来重放记录的分辨率,以将更改应用于从先前的冲突到先前的分辨率到当前的冲突状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM