如何使用 git cherry-pick 跳过不准确的重命名检测

How to skip inexact rename detection with git cherry-pick

我有大约 10 个提交,我需要从一个旧分支中挑选一个大型回购的当前分支。每次我 运行 cherry-pick 命令时,我都会得到以下信息:

$ git cherry-pick -x 11a77a55bf
Performing inexact rename detection:   0% (438032/938483560)

我第一次让它完成,大概用了10-15分钟。但它会为我选择的每个提交执行此操作。有没有办法防止这种情况,至少对于当前命令?

我尝试设置重命名限制但没有帮助:

git -c diff.renameLimit=1 cherry-pick -x 11a77a55bf
Performing inexact rename detection:   0% (1259342/938483560)

git cherry-pick 在后台使用合并机制,它有自己的与重命名检测相关的配置:merge.renameLimit.

git -c merge.renameLimit=1 cherry-pick -x 11a77a55bf

做你想做的。