Search code examples
gitgit-cherry-pick

How to skip inexact rename detection with git cherry-pick


I have a about 10 commits I need to cherry pick from an old branch to a current branch on a large repo. Every time I run the cherry-pick command I get the following:

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

I let it complete the first time, which took about about 10-15 minutes. But it does this for every commit I pick. Is there a way to prevent this, at least for the current command?

I tried setting a renameLimit but it didn't help:

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

Solution

  • git cherry-pick uses the merge machinery behind the scenes, which has its own configuration related to rename detection: merge.renameLimit.

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

    does what you want.