Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<h3>"Resolve" vs "Recursive" merge strategy</h3> <p>Recursive is the current default two-head strategy, but after some searching I finally found some info about the "resolve" merge strategy. </p> <p>Taken from O'Reilly book <a href="http://books.google.com/books?id=e9FsGUHjR5sC&amp;pg=PA142&amp;lpg=PA142&amp;dq=git%20merge%20%22-s%20resolve%22&amp;source=bl&amp;ots=Zi5h3H_bqh&amp;sig=Lp_-I3uOvMbYBcsraQEe6WbFMhU&amp;hl=en&amp;sa=X&amp;ei=cPW0T7qzEsae2gWeq9w9&amp;ved=0CGQQ6AEwAw#v=onepage&amp;q=git%20merge%20%22-s%20resolve%22&amp;f=false" rel="noreferrer">Version Control with Git</a> (<a href="http://rads.stackoverflow.com/amzn/click/B002L4EXHO" rel="noreferrer">Amazon</a>) (paraphrased):</p> <blockquote> <p>Originally, "resolve" was the default strategy for Git merges.</p> <p>In criss-cross merge situations, where there is more than one possible merge basis, the resolve strategy works like this: pick one of the possible merge bases, and hope for the best. This is actually not as bad as it sounds. It often turns out that the users have been working on different parts of the code. In that case, Git detects that it's remerging some changes that are already in place and skips the duplicate changes, avoiding the conflict. Or, if these are slight changes that do cause conflict, at least the conflict should be easy for the developer to handle..</p> </blockquote> <p>I have successfully merged trees using "resolve" that failed with the default recursive strategy. I was getting <code>fatal: git write-tree failed to write a tree</code> errors, and thanks to <a href="http://www.tommymorgan.com/2011/04/git-merge-fails-with-fatal-git-write.html" rel="noreferrer">this blog post</a> (<a href="http://web.archive.org/web/20110911184425/http://www.tommymorgan.com/2011/04/git-merge-fails-with-fatal-git-write.html" rel="noreferrer">mirror</a>) I tried "-s resolve", which worked. I'm still not exactly sure why... but I think it was because I had duplicate changes in both trees, and resolve "skipped" them properly.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload