Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

`-X patience` vs `-X diff-algorithm=patience` with `git merge-recursive`

What is the difference between git merge -s recursive -X patience other-branch git merge -s recursive -X diff-algorithm=patience other-branch

Also do either of git merge -s recursive -X patience -X diff-algorithm=patience other-branch git merge -s recursive -X patience -X diff-algorithm=histogram other-branch mean anything. If so, what?

like image 850
Daniel Mahler Avatar asked Feb 18 '26 15:02

Daniel Mahler


1 Answers

What is the difference between

git merge -s recursive -X patience other-branch
git merge -s recursive -X diff-algorithm=patience other-branch

None. -X patience is an old name for -X diff-algorithm=patience, dating back to when there was only one alternative. You can, currently, spell the histogram algorithm with -X histogram as well. The only one requiring -X diff-algorithm= is minimal.

Also do either of

git merge -s recursive -X patience -X diff-algorithm=patience other-branch
git merge -s recursive -X patience -X diff-algorithm=histogram other-branch

mean anything. If so, what?

The last algorithm chosen on the command line overrides any previous ones on the command line, so these both have the effect of ignoring the first -X option.

(Note that -s recursive is the default strategy for merge when merging two commits, so this is redundant as well. It doesn't hurt, it just makes no difference.)

like image 87
torek Avatar answered Feb 21 '26 15:02

torek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!