Julius Plenz – Blog

criss-cross subtree merges

Note to self: It is bad to rely on Git's magic of finding out whether you can fast-forward when doing a merge. The more clever way is to explicitly state what you want to do with aliases:

nfm = merge --no-ff     # no-ff-merge
ffm = merge --ff-only   #    ff-merge

I stumbled upon this today when I played around with subtree merges. Strangely, the results with the strategy subtree were not the same as with recursive's subtree=path option:

$ git merge -s recursive doc
$ git merge -Xsubtree=Documentation doc

Turns out that – in the special case I had created – Git could fast-forward the branch although it was a subtree merge, effectively ignoring any strategy option. Duh. I had already read, understood and tried all the tests related to merging before I had figured that out.

posted 2011-02-19 tagged git