git - 启用 git rerere 有什么缺点吗?

标签 git merge git-rerere

我已经阅读了有关 git 的 rerere 功能的各种信息,并且我正在考虑启用它。

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.

https://git-scm.com/book/en/v2/Git-Tools-Rerere

但我还没有看到任何人提到使用 rerere 时可能出现的任何问题。

我必须假设有一个缺点,否则它可能会默认启用。那么启用 rerere 有什么缺点吗?它会导致哪些原本不会发生的潜在问题?

最佳答案

如果 merge 不正确,则丢弃它,然后再次进行“相同” merge ,它会再次不正确。不过,您可能会忘记记录的分辨率。来自 the documentation :

git rerere forget <pathspec>

This resets the conflict resolutions which rerere has recorded for the current conflict in <pathspec>.

在特定路径上使用要小心;您不想随处吹走所有记录的决议。 (不带参数的 forget 已被设为 deprecated,以避免您执行此操作,除非您键入 git rerere forget . 明确请求它。)

但如果您不想这样做,您很可能最终会将错误的 merge 放入您的历史记录中。

关于git - 启用 git rerere 有什么缺点吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5519244/

相关文章:

Git:如何 rebase 和压缩从分支到主控的提交?

使用具有重叠列名的 Pandas 连接多个数据框?

用于避免日志中出现大量 merge 噪音的 Git 工作流程

git rerere 仅手动解决

git 我可以加速提交吗?

git - Git Post-Receive 的权限

git - 使用 Git 标签 - 无法提取新标签

r - 如何循环遍历数据框列表以在 R 中设置列​​名称?

git - 使用 merge 或 rebase 来维护一个部署分支

git - 压缩包含 merge 提交的前几十个 git 提交