Cherry picking could be not so fast, since it's probably detecting renames as part of the merge which can be expensive, especially when you're cherry-picking something which is far away from HEAD.
It may be that your git config has gc.auto = 0
(git config --get gc.auto
), so double check if it's enabled, or just run:
git gc
in order to cleanup unnecessary files and optimize the local repository.
You may also try setting the merge.renamelimit
config variable to something smaller (e.g. 1, since 0 means no limit). If this won't help, try to profile your git (e.g. using strace
or perf record git cherry-pick ...
) and find the bottleneck.
See: cherry-pick is slow
For merge-recursive, we would always want to compute the pair-wise
renames between each side and the ancestor. So that diff to the
cherry-pick destination is always going to be an expensive O(# of
changes between source and dest) operation.
Without renames, you could do better on the actual merge with a
three-way tree walk. E.g., you see that some sub-tree is at tree A in
the ours
and ancestor
trees, but at tree B in theirs
. So you don't
have to descend further, and can just say "take theirs" (well, you have
to descend theirs
to get the values). But I expect it gets more
complicated with the interactions with the index (and is probably not
worth spending much effort on because of the rename issue, anyway).
-Peff