title: Why can’t you merge in a bare git repo?
body: <p>Why can’t I <code>merge</code> into a bare repo? Bare repos don’t have a <code>HEAD</code> or a working tree. In the config file we can see <code>bare=true</code>.</p>
  
  <p>You also can’t <code>pull</code> in a bare repo (because pull = fetch &amp; merge and merge doesn't work). However, you can push to a bare repo – why? As far as I know, <code>push</code> also contains a merge, but in this case we can do it well.</p>
  
  <p>So, the question could be “how does git merge work?”. Why does it need a <code>HEAD</code>? What is it doing when merging?</p>