关于“diff.renamelimit 变量”的警告进行 git Push 时
我将本地提交推送到远程 git 服务器并收到以下警告消息:
remote: warning: only found copies from modified paths due to too many files.
remote: warning: you may want to set your diff.renamelimit variable to at least 19824 and retry the command.
但实际上我已经将 diff.renamelimit 设置为 0 (我认为零意味着无限,对吧?)。
$ git config --list
...
diff.renamelimit=0
那么我该怎么做才能避免这个警告呢?谢谢。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
merge.renameLimit 是什么意思
来源:https://git-scm.com/docs/git-merge
What does merge.renameLimit mean
source: https://git-scm.com/docs/git-merge
文档没有提到 0 作为
diff 的特殊值。重命名限制
。因此您应该将该限制设置为建议的值。
或者您可以尝试完全停用重命名检测。 (
git config diff.renames 0
)您将在这篇博文“
注意:Git 2.16(2018 年第一季度)将修改该限制:
从历史上看,用于重命名检测的 diff 机制有一个
32k 路径的硬编码限制;正在取消此功能以允许用户
贸易周期(可能)更容易阅读结果。
请参阅 提交 8997355(2017 年 11 月 29 日),作者:乔纳森·谭(
jhowtan
)。请参阅提交9268cf4,提交 9f7e4bf, 提交 d6861d0, 提交 b520abf(2017 年 11 月 13 日),作者:以利亚纽伦(
newren
)。(由 Junio C Hamano --
gitster
-- 合并于 提交6466854,2017 年 12 月 19 日)Git 2.17(2018 年第 2 季度)将避免在“
git diff
”输出行的中间显示警告消息。请参阅 提交 4e056c9(2018 年 1 月 16 日),作者:Nguyễn Thái Ngọc Duy (
pclouds
)。(由 Junio C Hamano --
gitster
-- 合并于 提交17c8e0b,2018 年 2 月 13 日)With Git 2.33 (Q3 2021), Documentation on "
git diff -l
"(man ) 和diff.renameLimit
已更新,并且这些限制的默认值已提高。请参阅提交94b82d5,提交 9dd29db, 提交 6623a52, 提交 05d2c61(2021 年 7 月 15 日),作者:以利亚纽伦(
newren
)。(由 Junio C Hamano --
gitster
-- 合并于 提交268055b,2021 年 7 月 28 日)diff-options
现在包含在其 手册页:The documentation doesn't mention 0 as a special value for
diff.renamelimit
.So you should set that limit to the value recommended.
Or you can try deactivating the rename detection altogether. (
git config diff.renames 0
)You will find a similar example in this blog post "Confluence, git, rename, merge oh my...":
Note: Git 2.16 (Q1 2018) will amend that limit:
Historically, the diff machinery for rename detection had a
hardcoded limit of 32k paths; this is being lifted to allow users
trade cycles with a (possibly) easier to read result.
See commit 8997355 (29 Nov 2017) by Jonathan Tan (
jhowtan
).See commit 9268cf4, commit 9f7e4bf, commit d6861d0, commit b520abf (13 Nov 2017) by Elijah Newren (
newren
).(Merged by Junio C Hamano --
gitster
-- in commit 6466854, 19 Dec 2017)Git 2.17 (Q2 2018) will avoid showing a warning message in the middle of a line of "
git diff
" output.See commit 4e056c9 (16 Jan 2018) by Nguyễn Thái Ngọc Duy (
pclouds
).(Merged by Junio C Hamano --
gitster
-- in commit 17c8e0b, 13 Feb 2018)With Git 2.33 (Q3 2021), documentation on "
git diff -l<n>
"(man) anddiff.renameLimit
have been updated, and the defaults for these limits have been raised.See commit 94b82d5, commit 9dd29db, commit 6623a52, commit 05d2c61 (15 Jul 2021) by Elijah Newren (
newren
).(Merged by Junio C Hamano --
gitster
-- in commit 268055b, 28 Jul 2021)diff-options
now includes in its man page:如果您不是经常遇到这个问题,而是它只是一次性的事情,那么更改全局配置的默认值可能是一种矫枉过正。我建议您只需使用
-c
选项来为这个命令设置一个特殊的配置。像这样的东西:In case you aren't constantly running into this problem, but instead it's just a one-off thing then changing the global config from it's default value might be an overkill. I would suggest you simply use the
-c
option to set a special config just for this one command. Something like: