启用 git rerere 有什么缺点吗? [英] Are there any downsides to enabling git rerere?

查看:24
本文介绍了启用 git rerere 有什么缺点吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了有关 git 的 rerere 功能的各种内容,我正在考虑启用它.

I've read various things about git's rerere feature, and I'm considering enabling it.

git rerere 功能有点隐藏.这个名字代表重用记录的解决方案",顾名思义,它允许你让 Git 记住你是如何解决一个大块冲突的,以便下次它看到相同的冲突时,Git 可以自动帮你解决.

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 时可能出现的任何问题.

But I haven't seen anyone mention any possible problems that could arise while using rerere.

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

I have to assume there is a downside, or it would probably be enabled by default. So is there any downside to enabling rerere? What potential problems can it cause that would not otherwise occur?

推荐答案

如果合并错误,则丢弃它,然后执行相同"的合并再次合并,它将再次不正确.不过,您可以忘记记录的分辨率.来自文档:

If you do a merge incorrectly, then discard it, then do the "same" merge again, it will be incorrect again. You can forget a recorded resolution, though. From the documentation:

git rerere 忘记

这将重置 rerere 在 中为当前冲突记录的冲突解决方案.

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

在特定路径上小心使用;您不想到处吹走您录制的所有分辨率.(forget 没有参数是 已弃用 以免您这样做,除非您键入 git rerere forget . 以明确请求它.)

Be careful to use it on specific paths; you don't want to blow away all of your recorded resolutions everywhere. (forget with no arguments has been deprecated to save you from doing this, unless you type git rerere forget . to explicitly request it.)

但如果您不考虑这样做,您很容易最终将错误的合并放入您的历史记录中..

But if you don't think to do that, you could easily end up putting that incorrect merge into your history..

这篇关于启用 git rerere 有什么缺点吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆