如何合并重命名或相似的文件?
您也可以尝试-Xrename-threshold=X来降低重命名相似度检测阈值。
git merge ... -Xrename-threshold=<20>
// Where 20 is the % of similarity in files
diff.renameLimit
The number of files to consider when performing the copy/rename
detection; equivalent to the git diff option -l.
merge.renameLimit
The number of files to consider when performing rename detection
during a merge; if not specified, defaults to the value of
diff.renameLimit.
来自git help merge(也在git help pull):
rename-threshold=<n>
Controls the similarity threshold used for rename detection.
See also git-diff(1) -M.
来自git help diff:
-M[<n>], --find-renames[=<n>]
Detect renames. If n is specified, it is a threshold on the
similarity index (i.e. amount of addition/deletions compared to the
file’s size). For example, -M90% means git should consider a
delete/add pair to be a rename if more than 90% of the file hasn’t
changed.