Interview Prep/Git & GitHub/Repository Health, Size and Performance

`warning: inexact rename detection was skipped due to too many files.` and `warning: you may want to set your merge.renameLimit variable to at least 5402 and retry the command.`

IntermediateTroubleshootingRepository Health, Size and Performance
Answer

Likely causes → A merge, cherry-pick or diff involves more added/deleted files than the rename-detection limit, so Git stopped looking for renames. A big directory move then shows as delete + add and produces bogus modify/delete conflicts.

Diagnose → Re-read the warning for the suggested number, and check git diff --stat -M <base> <branch> | tail -1.

Fix → Abort and retry with a higher limit:

git merge --abort
git -c merge.renameLimit=6000 merge feature
# for diffs: git -c diff.renameLimit=6000 diff -M main...feature

Prevent → Do large moves/renames in a dedicated commit with no content changes, so rename detection is exact and cheap.

All Git & GitHub questions Roadmap: Git & GitHub

More on Repository Health, Size and Performance