I’m pushing the local commit to the remote git server and got the following warning messages:
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.
But actually I’ve already set the diff.renamelimit to 0 (I think zero means unlimited, right?).
$ git config --list
...
diff.renamelimit=0
So what shall I do to avoid this warning? Thanks.
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.renameLimithave 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-optionsnow includes in its man page: