Change merge strategy from 'ort' to 'recursive'

Viewed 29

I don't know how, but default merge strategy is ort in my pc, but I want to change that to recursive. I referred some online sources but none of them were useful. Can someone tell me how can I change my default merge strategy?

1 Answers

You can't:1 the default merge strategy for git merge, git cherry-pick, etc., is hard-coded.2 You can easily run git merge -s recursive, either manually or through an alias.

The -s recursive and -s ort strategies are supposed to produce the same result except when -s recursive would bail out but -s ort can succeed. If you come across cases where this isn't true, report them to the Git developers.


1For some definition of "can't" anyway: if you work hard enough at it, you certainly could. For instance, just clone Git and customize it.

2For git merge in particular, the default is octopus when giving multiple heads, and otherwise is whichever of ort or recursive it is for your particular Git version.

Related