title: How does git merge after cherry-pick work?
body: <p>Let's imagine that we have a <code>master</code> branch.</p>
  
  <p>Then we create a <code>newbranch</code></p>
  
  <pre><code>git checkout -b newbranch
  </code></pre>
  
  <p>and make two new commits to <code>newbranch</code>: <em>commit1</em> and <em>commit2</em></p>
  
  <p>Then we switch to master and make <code>cherry-pick</code></p>
  
  <pre><code>git checkout master
  git cherry-pick hash_of_commit1
  </code></pre>
  
  <p>Looking into <code>gitk</code> we see that <em>commit1</em> and its cherry-picked version have different hashes, so technically they are two different commits.</p>
  
  <p>Finally we merge <code>newbranch</code> into <code>master</code>:</p>
  
  <pre><code>git merge newbranch
  </code></pre>
  
  <p>and see that these two commits with different hashes were merged without problems although they imply that the same changes should be applied twice, so one of them should fail.</p>
  
  <p>Does git really do a smart analysis of commit's content while merging and decide that changes shouldn't be applied twice or these commits are marked internally as linked together?</p>