title: Why does git checkout with explicit refs/heads/branch give detached HEAD?
body: <p>If I checkout a branch using just the branch name, <code>HEAD</code> is updated to point at that branch.</p>
  
  <pre><code>$ git checkout branch
  Switched to branch 'branch'
  </code></pre>
  
  <p>If I checkout a branch by using <code>refs/heads/branch</code> or <code>heads/branch</code>, <code>HEAD</code> becomes detached.</p>
  
  <pre><code>$ git checkout refs/heads/branch
  Note: checking out 'refs/heads/branch'.
  
  You are in 'detached HEAD' state. You can look around, make experimental
  changes and commit them, and you can discard any commits you make in this
  state without impacting any branches by performing another checkout.
  
  $ git checkout "refs/heads/branch"
  Same result
  
  $ git checkout heads/branch
  Same result
  </code></pre>
  
  <p>Why? If its version dependent, I have git 1.7.9.5 on Ubuntu 12.04.3.</p>