GIT 警告:太多文件跳过不精确的重命名检测

发布于 2024-10-20 06:25:11 字数 172 浏览 2 评论 0原文

我知道默认的重命名限制是100,我们可以使用配置 diff.renamelimit config 来增加这个值,

我担心的是,如果不设置这个配置,会不会出现错误合并或缺少任何代码? 我正在尝试合并(git merge)两个有巨大变化的分支。

有人可以更详细地了解此配置设置吗?

I am aware that the default rename limit is 100 and we can increase this value using the config diff.renamelimit config

What I am worried about is that, if this config is not setup, will there be a wrong merge or any missing code?
I am trying to merge (git merge) 2 branches that have huge changes.

Can someone throw more light about this config setting?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

逆光飞翔i 2024-10-27 06:25:11

如果这对任何人有帮助,我在一个分支中有很多文件(数百个,如果不是数千个),而这些文件尚未在另一个分支中。 运行出现以下错误

$ git config merge.renamelimit 15345

合并消失时

$ git merge master
.
.
.
warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your merge.renamelimit variable to at least 15345 and retry the command.

In case this helps anyone, I had a lot of files (hundreds, if not thousands) in one branch, which were not yet in the other branch. Running

$ git config merge.renamelimit 15345

made the below error when merging go away

$ git merge master
.
.
.
warning: inexact rename detection was skipped due to too many files.
warning: you may want to set your merge.renamelimit variable to at least 15345 and retry the command.
じ违心 2024-10-27 06:25:11

您的内容是安全的。

据我了解, git 实际上没有任何一流的 <​​code>rename 操作的概念(三大巨头中只有 bzr 有) DVCS):mv 是底层机制之上的糖,它基本上是一个 add 和一个 rm。不过,由于 git 可以跟踪此类操作期间更改的内容,因此它可以使用启发式方法来猜测 addrm 何时实际上是一个mv。因为这比仅仅显示 git 实际记录的内容需要更多的工作 - git-diff 的文档解释说它“...需要 O(n^2) 处理时间其中 n 是潜在的重命名/复制目标的数量”——当涉及太多文件时,git 不会尝试它。您提到的设置仅控制该阈值。

Your content is safe.

As I understand it, git doesn't actually have any concept of a first-class rename operation (only bzr does, of the big 3 DVCSs): the mv is sugar on top of the underlying machinery, which is basically an add and a rm. Since git can track the content that changes during such operations, though, it can use heuristics to guess when an add and a rm are actually a mv. Since that takes way more work than just displaying what git actually recorded—the docs for git-diffexplain that it "...require O(n^2) processing time where n is the number of potential rename/copy targets"—git won't try it when too many files are involved. The setting you mention just controls that threshold.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文