简体   繁体   English

Git rerere和解决方案涵盖非冲突文件

[英]Git rerere and resolution covering non-conflicting files

I experienced the following situation: 我遇到了以下情况:

I ran into a conflict during a merge with git rerere enabled . 我在git rerere enabled的合并期间遇到了冲突。

I fixed the conflicting file, but other non-conflicting files had to be adjusted, too. 我修复了冲突的文件,但也必须调整其他非冲突的文件。
All touched files were added and committed. 所有触摸的文件都已添加并提交。 git rerere stated that it has recorded the resolution. git rerere表示它已经记录了决议。

A later git pull --rebase=preserve repeated the merge conflicts and git rerere came to the rescue. 后来的git pull --rebase=preserve重复合并冲突和git rerere来救援。
However, only the part of the resolution in the conflicting files was applied, the changes in the other files were not. 但是,仅应用了冲突文件中的部分分辨率,其他文件中的更改不是。
A quick glance in the rr-cache indicates that those other changes have not been recorded. 快速浏览rr-cache表示尚未记录其他更改。

Is git rerere only recording changes in the directly conflicting files and nothing else? git rerere只记录直接冲突文件中的更改而没有其他内容吗?

Is there an option to record all changes done in the resolving commit, not only the conflicting file? 是否有选项可以记录在解析提交中完成的所有更改,而不仅仅是冲突的文件?

Is git rerere only recording changes in the directly conflicting files and nothing else? git rerere只记录直接冲突文件中的更改而没有其他内容吗?

Yes. 是。 Well, almost—it's slightly more complicated. 嗯,几乎 - 它稍微复杂一些。

Is there an option to record all changes done in the resolving commit, not only the conflicting file? 是否有选项可以记录在解析提交中完成的所有更改,而不仅仅是冲突的文件?

No, and this is where the "slightly more complicated" part comes in. The rerere code doesn't record all the changes and resolutions; 不,这就是“稍微复杂一点”的部分rerere代码不记录所有的变化和分辨率; it only records the conflicting changes and their corresponding resolutions. 它只记录冲突的变化及其相应的决议。 The non-conflicting bits are not saved at all. 根本不保存非冲突位。

(Note, by the way, that git rebase --preserve actually re-creates the merges, ie, does new git merge commands, as I think you've already observed. Invoking it from git pull has no effect on this part of the process.) (注意,顺便说一句, git rebase --preserve实际上重新创建了合并,即,我认为你已经观察到了新的git merge命令。从git pull调用它对这部分没有影响处理。)

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

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