title: How does 'git merge' work in details?
body: <p>I want to know an exact algorithm (or near that) behind 'git merge'. The answers at least to these sub-questions will be helpful:</p>
  
  <ul>
  <li>How does git detect the context of a particular non-conflicting change?</li>
  <li>How does git find out that there is a conflict in these exact lines?</li>
  <li>Which things does git auto-merge?</li>
  <li>How does git perform when there is no common base for merging branches?</li>
  <li>How does git perform when there are multiple common bases for merging branches?</li>
  <li>What happens when I merge multiple branches at once?</li>
  <li>What is a difference between merge strategies?</li>
  </ul>
  
  <p>But the description of a whole algorithm will be much better.</p>