title: Why this merge works fine (add a new file) while rebase resulted in conflict?
body: <p><a href="https://i.stack.imgur.com/MjQEs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MjQEs.png" alt="merge vs rebase"></a></p>
  
  <p>commit <strong>b2e01e2</strong> added a new file, when merge it into the main branch at 4dee649, it works just fine, the new file was added.</p>
  
  <p>While rebase <strong>b2e01e2</strong> onto the main branch will result in a conflict at another file.</p>
  
  <p>The previous merge of the commit <strong>84b064f</strong> into the main branch at commit <strong>7f5db59</strong> was indeed caused a conflict at that file and it was resolved at <strong>7f5db59</strong>. </p>
  
  <p>I checked the discussion at <a href="https://stackoverflow.com/questions/44530822/is-merge-without-conflicts-equivalent-to-rebase-without-conflicts">Is merge without conflicts equivalent to rebase without conflicts?</a>. But the problem there was the rebased branch has a file conflicted with another file at the main branch, which is not my case.</p>
  
  <p>This discussion <a href="https://stackoverflow.com/questions/38391714/git-why-does-rebase-result-in-conflicts-while-merge-does-not">Git: Why does rebase result in conflicts while merge does not?</a> said "It is possible that one of those commits has a conflict that you solved in a subsequent commit." seems to be my case. But I still don't have a clear idea why rebase the newly added file will resulted a conflict at another file.</p>
  
  <p>My second question is when I better use merge instead of rebase ? In my case it seems that if there is ever a conflict in the branch since the common base(commit aee4164 in my case) I better use merge instead of rebase. But is this the case ?</p>